Update homekit to improve representation of activity based remotes (#47261)
This commit is contained in:
parent
3f2ca16ad7
commit
fd310e1f41
8 changed files with 398 additions and 109 deletions
|
@ -16,6 +16,7 @@ from homeassistant.components.media_player import (
|
|||
DEVICE_CLASS_TV,
|
||||
DOMAIN as MEDIA_PLAYER_DOMAIN,
|
||||
)
|
||||
from homeassistant.components.remote import DOMAIN as REMOTE_DOMAIN, SUPPORT_ACTIVITY
|
||||
from homeassistant.const import (
|
||||
ATTR_CODE,
|
||||
ATTR_DEVICE_CLASS,
|
||||
|
@ -503,4 +504,6 @@ def state_needs_accessory_mode(state):
|
|||
return (
|
||||
state.domain == MEDIA_PLAYER_DOMAIN
|
||||
and state.attributes.get(ATTR_DEVICE_CLASS) == DEVICE_CLASS_TV
|
||||
or state.domain == REMOTE_DOMAIN
|
||||
and state.attributes.get(ATTR_SUPPORTED_FEATURES) & SUPPORT_ACTIVITY
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue