Interface TelevisionAccessory

    • Method Detail

      • isActive

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

        java.util.concurrent.CompletableFuture<java.lang.Void> setActive​(boolean state)
                                                                  throws java.lang.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:
        java.lang.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

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

        java.util.concurrent.CompletableFuture<java.lang.Void> setActiveIdentifier​(java.lang.Integer identifier)
                                                                            throws java.lang.Exception
        Sets the active identifier
        Parameters:
        identifier - the active identifier
        Returns:
        a future that completes when the active identifier is changed
        Throws:
        java.lang.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

        java.util.concurrent.CompletableFuture<java.lang.String> getConfiguredName()
        Retrieves configured name.
        Returns:
        configured name
      • setConfiguredName

        java.util.concurrent.CompletableFuture<java.lang.Void> setConfiguredName​(java.lang.String name)
                                                                          throws java.lang.Exception
        Sets the configured name
        Parameters:
        name - configured name
        Returns:
        a future that completes when the change is made
        Throws:
        java.lang.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.
      • setRemoteKey

        java.util.concurrent.CompletableFuture<java.lang.Void> setRemoteKey​(RemoteKeyEnum key)
                                                                     throws java.lang.Exception
        Sends the remote key.
        Parameters:
        key - remote key
        Returns:
        a future that completes when the change is made
        Throws:
        java.lang.Exception - when the change cannot be made
      • getSleepDiscoveryMode

        java.util.concurrent.CompletableFuture<SleepDiscoveryModeEnum> getSleepDiscoveryMode()
        Retrieves the sleep discovery mode.
        Returns:
        a future that will contain the sleep discovery mode .
      • 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 java.util.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.