-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Make RainMachine async #14879
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
Make RainMachine async #14879
Conversation
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.
Why is Python 3.6 required for the regenmaschine library? Home assistant only requires Python 3.5.3.
async def refresh_sensors(event_time): | ||
"""Refresh RainMachine sensor data.""" | ||
_LOGGER.debug('Updating RainMachine sensor data') | ||
await hass.data[DATA_RAINMACHINE].async_update() |
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.
rainmachine
is directly accessible here so no need to access the dict to get it.
@@ -20,7 +20,10 @@ | |||
_LOGGER = logging.getLogger(__name__) | |||
|
|||
|
|||
def setup_platform(hass, config, add_devices, discovery_info=None): | |||
async def async_setup_platform(hass, |
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.
Please break line after the parenthesis instead, and fill out as much as possible of the line. That's more in line with home assistant style.
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.
FYI, I found a lot of other style inconsistencies based on your above request, so I went ahead and addressed them.
@MartinHjelmare 3.6 was a mistake on my part; changed the library to require 3.5 as the minimum. Thanks for catching! |
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.
Nice!
Description:
This PR:
regenmaschine
) to 1.0.1.Related issue (if applicable): N/A
Pull request in home-assistant.github.io with documentation (if applicable): N/A
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:
- [ ] Documentation added/updated in home-assistant.github.ioIf the code communicates with devices, web services, or third-party tools:
- [ ] New dependencies have been added to theREQUIREMENTS
variable (example).- [ ] New dependencies are only imported inside functions that use them (example).- [ ] New or updated dependencies have been added torequirements_all.txt
by runningscript/gen_requirements_all.py
.- [ ] New files were added to.coveragerc
.