home-assistant.io icon indicating copy to clipboard operation
home-assistant.io copied to clipboard

Updating the Apple TV integration examples: How to deal with a turned off remote entity

Open Someone0nEarth opened this issue 3 years ago • 1 comments

Feedback

Sometimes the Apple TV remote entity is not turned on, so the scripts in the examples are not working (at least for me on tvOS 16.0 and Apple TV 4K 2. Gen).

Fix: Ensuring in the scripts, that the remote entity is turned on.

Maybe updating the examples on the integration page?

Example:

apple_tv_sleep:
  alias: "Make the Apple TV sleep"
  sequence:
  - if:
    - condition: device
      type: is_off
      device_id: <lounge_appletv_device_id>
      entity_id: remote.lounge_appletv
      domain: remote
    then:
    - type: turn_on
      device_id: <lounge_appletv_device_id>
      entity_id: remote.lounge_appletv
      domain: remote
    - wait_for_trigger:
      - platform: device
        type: turned_on
        device_id: <lounge_appletv_device_id>
        entity_id: remote.lounge_appletv
        domain: remote
  - service: remote.send_command
      target:
        entity_id: remote.lounge_appletv
      data:
        delay_secs: 1
        command:
          - home_hold
          - select
  - service: media_player.turn_off
      target:
        entity_id: media_player.lounge_appletv
  mode: single

Thanks for the integration!

Best regards, Someone

URL

https://www.home-assistant.io/integrations/apple_tv/

Version

2022.8.7

Additional information

No response

Someone0nEarth avatar Sep 18 '22 17:09 Someone0nEarth

Hey there @postlund, mind taking a look at this feedback as it has been labeled with an integration (apple_tv) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved. If this issue is still relevant, please let us know by leaving a comment 👍 This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 18 '22 11:11 github-actions[bot]