Interface TelevisionAccessory

    • Method Detail

      • isActive

        CompletableFuture<Boolean> isActive()
        Retrieves the current active state of the TV.
        Returns:
        a future that will contain the state
      • setActive

        CompletableFuture<Void> setActive​(boolean state)
                                   throws Exception
        Sets the active state of the TV
        Parameters:
        state - the state to set
        Returns:
        a future that completes when the change is made
        Throws:
        Exception - when the change cannot be made
      • subscribeActive

        void subscribeActive​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the active state of the TV .
        Parameters:
        callback - the function to call when the active state changes.
      • unsubscribeActive

        void unsubscribeActive()
        Unsubscribes from changes in the active state of the TV.
      • getActiveIdentifier

        CompletableFuture<Integer> getActiveIdentifier()
        Retrieves the active identifier
        Returns:
        a future that will contain the active identifier.
      • setActiveIdentifier

        CompletableFuture<Void> setActiveIdentifier​(Integer identifier)
                                             throws Exception
        Sets the active identifier
        Parameters:
        identifier - the active identifier
        Returns:
        a future that completes when the active identifier is changed
        Throws:
        Exception - when the active identifier cannot be set
      • subscribeActiveIdentifier

        void subscribeActiveIdentifier​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the active identifier.
        Parameters:
        callback - the function to call when the active identifier changes.
      • unsubscribeActiveIdentifier

        void unsubscribeActiveIdentifier()
        Unsubscribes from changes in the active identifier.
      • getConfiguredName

        CompletableFuture<String> getConfiguredName()
        Retrieves configured name.
        Returns:
        configured name
      • setConfiguredName

        CompletableFuture<Void> setConfiguredName​(String name)
                                           throws Exception
        Sets the configured name
        Parameters:
        name - configured name
        Returns:
        a future that completes when the change is made
        Throws:
        Exception - when the change cannot be made
      • subscribeConfiguredName

        void subscribeConfiguredName​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in configured name.
        Parameters:
        callback - the function to call when the configureed name changes.
      • unsubscribeConfiguredName

        void unsubscribeConfiguredName()
        Unsubscribes from changes in the configured name state.
      • subscribeSleepDiscoveryMode

        void subscribeSleepDiscoveryMode​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in sleep discovery mode.
        Parameters:
        callback - the function to call when the sleep discovery mode changes.
      • unsubscribeSleepDiscoveryMode

        void unsubscribeSleepDiscoveryMode()
        Unsubscribes from changes in the sleep discovery mode.
      • getServices

        default Collection<Service> getServices()
        Description copied from interface: HomekitAccessory
        The collection of Services this accessory supports. Services are the primary way to interact with the accessory via HomeKit. Besides the Services offered here, the accessory will automatically include the required information service.

        This method will only be useful if you're implementing your own accessory type. For the standard accessories, use the default implementation provided by the interfaces in io.github.hapjava.accessories.

        Specified by:
        getServices in interface HomekitAccessory
        Returns:
        the collection of services.