Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Fixes a lack of checks in get_all_motion_states() #90

Merged
merged 1 commit into from
Aug 31, 2022
Merged

Fixes a lack of checks in get_all_motion_states() #90

merged 1 commit into from
Aug 31, 2022

Conversation

JimStar
Copy link

@JimStar JimStar commented Aug 29, 2022

Looks like this issue affected the Home Assistant component depending on this lib, issue: fwestenberg/reolink_dev#550

There was definitely an inconsistency between get_all_motion_states() and get_motion_state() in this code: while get_motion_state() checks the response from cameras/NVR, the get_all_motion_states() just blindly passed the response to json.loads() (which in case of empty response lead to problems in Home Assistant), and never called clear_token() which could be a source of Home Assistant problems too...

I'm still testing these changes locally, maybe later I'll find some more fixes that still affect Home Assistant - but this one is definitely an issue that asks to be fixed, so I think it would be safe if you'd accept this pull-request...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants