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
Rewrite of Toon component #21186
Rewrite of Toon component #21186
Conversation
9c818dd
to
3175728
Compare
Looking all good ! 🎉 Final step is to add a test for the config flow. |
46622bd
to
192335e
Compare
Rebased in order to pick up the increased Travis timeout from #21447. |
|
||
conf = hass.data.get(DATA_TOON_CONFIG) | ||
|
||
toon = Toon(entry.data[CONF_USERNAME], entry.data[CONF_PASSWORD], |
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.
This seems to make requests upon instantiation, ie I/O. We're not allowed to do I/O in coroutines, as they are executed in the event loop.
|
||
app = self.hass.data.get(DATA_TOON_CONFIG, {}) | ||
try: | ||
toon = Toon(user_input[CONF_USERNAME], |
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 above.
|
||
app = self.hass.data.get(DATA_TOON_CONFIG, {}) | ||
try: | ||
Toon(self.username, |
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 above.
"""Get the latest data from the sensor.""" | ||
self.thermos.update() | ||
section = getattr(self.toon, self.section) |
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.
This also seems to do requests if the cache is old.
|
||
async def async_update(self) -> None: | ||
"""Get the latest data from the binary sensor.""" | ||
section = getattr(self.toon, self.section) |
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.
This also seems to do requests if the cache is old.
Above comments by @MartinHjelmare addressed in #21657 |
A question to everyone who have boiler modulationWhen I look at the boiler modulation level I came to the conclusion that the status is not right.
Who has a difference in modulation level? note: I have a nefit Trendline. |
Please open an issue if you suspect a bug. If you need help please use our help channels: Merged PRs should not be used for support or bug reports. Thanks! |
Description:
This is a rewrite of the Toon component for Home Assistant.
The current version uses an HTTP endpoint, originally created by the vendor for their web app. They discontinued this application quite some time ago, and now the service was taken offline as well; hence the component is now broken (see #21010 and the portal that was taken down).
Luckily, Toon has an API available, which this PR implements by using the
toonapilib
package created by @costastf. This package has been used in the custom Toon component by @krocat. Thetoonapilib
therefore has been matured for quite some time already.This component rewrite is not a copy, nor does it use the custom component listed above. This rewrite is focussed to integrate within Home Assistant using a configuration flow, to be async and uses the device & entity registry.
This component will, just like the current version, still have the issue in setting a temperature via Google Assistant. In order to fix this, without doing ugly things, requires home-assistant/architecture#22 to be resolved.
Support for smoke detectors and switches (wall-plugs) has been removed. Support for lights is not implemented/added. The devices supported by Toon are also supported by HA natively (Hue/Fibaro).
Personal reference:
frenck-2019-0026
Breaking Change:
Rewrite of the Toon component: now requires a Toon API developer account and can be configured using via the Home Assistant integrations. Support for Switches & Smoke detectors has been removed.
Related issue (if applicable): fixes #21010
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#8627
Example entry for
configuration.yaml
(if applicable):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: