Skip to content

Fix AttributeError when digest 'light' field is a list#440

Open
Araanda41 wants to merge 1 commit into
albertogeniola:0.4.X.Xfrom
Araanda41:0.4.X.X
Open

Fix AttributeError when digest 'light' field is a list#440
Araanda41 wants to merge 1 commit into
albertogeniola:0.4.X.Xfrom
Araanda41:0.4.X.X

Conversation

@Araanda41

Copy link
Copy Markdown

Devices without light capability (e.g. mrs100 roller shutters) can report
digest.light as an empty list [] instead of omitting the key.
LightMixin.async_handle_update then called .get('channel') on that
list, raising:

AttributeError: 'list' object has no attribute 'get'

on every full state update (SYSTEM_ALL), which aborted the device
update entirely and left the entity unavailable in Home Assistant.

This normalizes list values before use and skips the light-status
update when there is no actual light data.

Reproduced on mrs100, HW 7.0.0, FW 7.6.20.
Related: albertogeniola/meross-homeassistant#586

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant