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` - `wakeup`
- `suspend` - `suspend`
- `home` - `home`
- `home_hold`
- `top_menu` - `top_menu`
- `menu` - `menu`
- `select` - `select`
@ -113,11 +112,12 @@ The following commands are currently available:
### Service `send_command` ### Service `send_command`
| Service data<br>attribute | Optional | Description | | Service data<br>attribute | Optional | Description |
| ------------------------- | -------- | ---------------------------------------------------------------------------------------------- | | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `entity_id` | no | `entity_id` of the Apple TV | | `entity_id` | no | `entity_id` of the Apple TV |
| `command` | no | Command, or list of commands to be sent | | `command` | no | Command, or list of commands to be sent |
| `num_repeats` | yes | Number of times to repeat the commands | | `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. | | `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 ### Examples
@ -140,20 +140,27 @@ lounge_appletv_netflix:
- select - 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: the Media Player:
```yaml ```yaml
apple_tv_sleep: apple_tv_sleep:
alias: "Make the Apple TV sleep" alias: "Make the Apple TV sleep"
sequence: sequence:
- service: remote.send_command
target:
entity_id: remote.lounge_appletv
data:
hold_secs: 1
delay_secs: 1
command:
- home
- service: remote.send_command - service: remote.send_command
target: target:
entity_id: remote.lounge_appletv entity_id: remote.lounge_appletv
data: data:
delay_secs: 1 delay_secs: 1
command: command:
- home_hold
- select - select
- service: media_player.turn_off - service: media_player.turn_off
target: target:
@ -178,7 +185,7 @@ data:
### My Apple TV does not turn on/off when I press on/off in the frontend ### 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 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. running tvOS 14.0 or later.
### Is it possible to see if a device is on without interacting with it ### Is it possible to see if a device is on without interacting with it