Update homekit to improve representation of activity based remotes (#47261)

This commit is contained in:
J. Nick Koston 2021-03-21 18:55:20 -10:00 committed by GitHub
parent 3f2ca16ad7
commit fd310e1f41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 398 additions and 109 deletions

View file

@ -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
)