Improve stability of homekit media players (#35080)

This commit is contained in:
J. Nick Koston authored and Paulus Schoutsen committed 2020-05-02 14:59:22 -07:00
1 parent a083eb334e
commit bd882fa4e4
5 files changed
+125 -35

No files matched your search

+3 -4
View File
@@ -275,13 +275,12 @@ def get_accessory(hass, driver, state, aid, config):
elif state.domain == "media_player":
device_class = state.attributes.get(ATTR_DEVICE_CLASS)
feature_list = config.get(CONF_FEATURE_LIST)
feature_list = config.get(CONF_FEATURE_LIST, [])
if device_class == DEVICE_CLASS_TV:
a_type = "TelevisionMediaPlayer"
else:
if feature_list and validate_media_player_features(state, feature_list):
a_type = "MediaPlayer"
elif validate_media_player_features(state, feature_list):
a_type = "MediaPlayer"
elif state.domain == "sensor":
device_class = state.attributes.get(ATTR_DEVICE_CLASS)