Added select hold to AppleTV core integration (#30323)

This commit is contained in:
myMartek 2024-04-22 09:31:16 +02:00 committed by GitHub
parent ecb4316e81
commit b4af6530e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,7 +91,6 @@ The following commands are currently available:
- `wakeup`
- `suspend`
- `home`
- `home_hold`
- `top_menu`
- `menu`
- `select`
@ -113,11 +112,12 @@ The following commands are currently available:
### Service `send_command`
| Service data<br>attribute | Optional | Description |
| ------------------------- | -------- | ---------------------------------------------------------------------------------------------- |
| ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `entity_id` | no | `entity_id` of the Apple TV |
| `command` | no | Command, or list of commands to be sent |
| `num_repeats` | yes | Number of times to repeat the commands |
| `delay_secs` | yes | Interval in seconds between one send and another <br> This is a `float` value e.g. 1, 1.2 etc. |
| `hold_secs` | yes | Number of seconds to hold the button. <br> This is a `float` value but please use 0 for not hold and 1 for holding the button |
### Examples
@ -140,20 +140,27 @@ lounge_appletv_netflix:
- select
```
Script using the `home_hold` command to send your Apple TV to sleep and turn off
Script using the quick action menu to send your Apple TV to sleep and turn off
the Media Player:
```yaml
apple_tv_sleep:
alias: "Make the Apple TV sleep"
sequence:
- service: remote.send_command
target:
entity_id: remote.lounge_appletv
data:
hold_secs: 1
delay_secs: 1
command:
- home
- service: remote.send_command
target:
entity_id: remote.lounge_appletv
data:
delay_secs: 1
command:
- home_hold
- select
- service: media_player.turn_off
target:
@ -178,7 +185,7 @@ data:
### My Apple TV does not turn on/off when I press on/off in the frontend
That is correct; it only toggles the power state in Home Assistant. See the
example above to use the `home_hold` command. This can be used on Apple TVs
example above to use the quick action menu. This can be used on Apple TVs
running tvOS 14.0 or later.
### Is it possible to see if a device is on without interacting with it