Apply late review comments on media player (#106727)

This commit is contained in:
Michael 2024-01-02 13:37:58 +01:00 committed by Franck Nijhof
parent 77cdc10883
commit 5eb1073b4a
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -27,7 +27,7 @@ SIGNIFICANT_ATTRIBUTES: set[str] = {
ATTR_ENTITY_PICTURE_LOCAL, ATTR_ENTITY_PICTURE_LOCAL,
ATTR_GROUP_MEMBERS, ATTR_GROUP_MEMBERS,
*ATTR_TO_PROPERTY, *ATTR_TO_PROPERTY,
} } - INSIGNIFICANT_ATTRIBUTES
@callback @callback
@ -44,18 +44,10 @@ def async_check_significant_change(
return True return True
old_attrs_s = set( old_attrs_s = set(
{ {k: v for k, v in old_attrs.items() if k in SIGNIFICANT_ATTRIBUTES}.items()
k: v
for k, v in old_attrs.items()
if k in SIGNIFICANT_ATTRIBUTES - INSIGNIFICANT_ATTRIBUTES
}.items()
) )
new_attrs_s = set( new_attrs_s = set(
{ {k: v for k, v in new_attrs.items() if k in SIGNIFICANT_ATTRIBUTES}.items()
k: v
for k, v in new_attrs.items()
if k in SIGNIFICANT_ATTRIBUTES - INSIGNIFICANT_ATTRIBUTES
}.items()
) )
changed_attrs: set[str] = {item[0] for item in old_attrs_s ^ new_attrs_s} changed_attrs: set[str] = {item[0] for item in old_attrs_s ^ new_attrs_s}