-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
WIP: vacuum.xiaomi_miio: 8000 read dnd status properly instead of using impreci… #9733
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
Conversation
Looks good to me, but to complete the change of name, the The |
I suppose the required
So this code can't work: ATTR_DO_NOT_DISTURB: STATE_ON if self.dnd_state.enabled else STATE_OFF,
ATTR_DO_NOT_DISTURB_START: str(self.dnd_state.start),
ATTR_DO_NOT_DISTURB_END: str(self.dnd_state.end), |
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.
@rytilahti, if this change has to be tested with a new 0.3.0 future release of the miio
library, please advise on how to get that 0.3.0 code to test against.
@@ -21,7 +21,7 @@ | |||
ATTR_ENTITY_ID, CONF_HOST, CONF_NAME, CONF_TOKEN, STATE_OFF, STATE_ON) | |||
import homeassistant.helpers.config_validation as cv | |||
|
|||
REQUIREMENTS = ['python-mirobo==0.2.0'] | |||
REQUIREMENTS = ['python-miio==0.2.0'] |
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.
You need to review the mirobo
imports down there, not all are changed to miio
imports.
Example: L92
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.
Yup, they are there for now as there has been no real releases of python-miio yet. I'm still working on some changes on python-miio I want to get it in before pushing this PR forwards. For now it's just for curious people to test it out (requires installing the master branch atm).
STATE_ON if self.vacuum_state.dnd else STATE_OFF, | ||
STATE_ON if self.dnd_state.enabled else STATE_OFF, | ||
ATTR_DO_NOT_DISTURB_START: str(self.dnd_state.start), | ||
ATTR_DO_NOT_DISTURB_END: str(self.dnd_state.end), |
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.
As in python-miio
v0.2.0, self.dnd_state
is a list with one dict, I suppose with the new version that would be an object. If not, this won't work.
@@ -375,6 +380,9 @@ def async_update(self): | |||
self._vacuum.consumable_status) | |||
self.clean_history = yield from self.hass.async_add_job( | |||
self._vacuum.clean_history) | |||
self.dnd_state = yield from self.hass.async_add_job( | |||
self._vacuum.dnd_status) | |||
|
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.
See my last comment
The version will be bumped later on when it's time to make a release, this code currently depends on the unreleased master of |
…se dnd flag from vacuum_state
f351eb2
to
bb65b19
Compare
This PR seems to have gone stale. Closing it. You can reopen it when you're ready to finish it. |
…se dnd flag from vacuum_state
Description:
The value stored in the
vacuum_state
'sdnd
is not precise, and does not at least always correlate with the correct state. Therefore another call has to be made to find out the real settings.This also exposes the currently used start and end hours.
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass