-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
[sensor/sma] SMA Solar Inverter sensor #5118
Conversation
@kellerza, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @robbiet480 to be potential reviewers. |
@pvizeli this sensor need to close it's session on EVENT_HOMEASSISTANT_STOP. It uses async and the shared aiohttp Unfortunately the session gets closed before the sensor gets time to send it's "logout" request. This raises the following exception Any ideas how we can keep the |
@kellerza create you own session without auto cleanup and cleanup self after close. See on helpers/aiohttp_client |
I will change that the default session close with connector, so you code will work. I make a PR for that at morning. |
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. Only a short comment and I merge it.
yield from asyncio.wait(tasks, loop=hass.loop) | ||
|
||
secs = range(0, 60, config.get(CONF_SCAN_INTERVAL, 5)) | ||
async_track_utc_time_change(hass, async_sma, second=secs) |
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.
We have a new helpers with timedelta support and now CONF_SCAN_INTERVAL is also a timedelta.
Description:
This is a sensor for an SMA solar inverter with WebConnect.
There are 4 predefined sensors, but new sensor keys can be added in the
custom
section. These values can found by inspecting the local web interface's traffic.Currently tested on Sunnyboy 1.5 (should be ok for 2.5)
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#1668
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
.