-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MyQ cover return unknown state if not available #17207
Conversation
'opening': STATE_OPENING, | ||
'stopped': STATE_STOPPED, | ||
'transition': STATE_TRANSITION, | ||
'unknown': STATE_UNKNOWN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use STATE_UNKNOWN
. Use None
to represent unknown state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks for the help.
@@ -21,11 +21,16 @@ | |||
|
|||
DEFAULT_NAME = 'myq' | |||
|
|||
STATE_STOPPED = 'stopped' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only states defined in the base cover component are allowed.
@@ -128,4 +133,4 @@ def unique_id(self): | |||
|
|||
def update(self): | |||
"""Update status of cover.""" | |||
self._status = self.myq.get_status(self.device_id) | |||
self._status = MYQ_TO_HASS.get(self.myq.get_status(self.device_id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._status
should represent the myq state not the home assistant state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Can be merged when PR description is updated to latest changes and build passes. |
Updated title and description, thanks for the help on this! |
* Add additional supported states * Use get method for lookup * Return None if unable to get status
Description:
None
rather than assumeSTATE_CLOSED
STATE_UNKNOWN
if unable to update statusRelated issue (if applicable): related to, but doesn't directly fix #16885
Pull request in home-assistant.io with documentation (if applicable): N/A
Example entry for
configuration.yaml
(if applicable):N/A
Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices: