-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Add last_reset for Sense trend sensors #63490
Conversation
Please add a link to the changelog in the description |
@emontnemery Made some updates to the library - it seems the API will return the start of the trend data if you pass it what it'd expecting. Much less difference in HA now |
Thats a lot cleaner. I'll install this on my production systems and report back in a few days |
This looks perfectly fine from a Home Assistant POV now. A comment on the change in the library though, please don't do bare excepts, do like this instead: try:
start_iso = self._trend_data[scale]['start'].replace('Z', '+00:00')
return datetime.strptime(start_iso, '%Y-%m-%dT%H:%M:%S.%f%z')
- except:
+ except Exception:
return None |
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.
So far so good. Waiting for the day to roll over to confirm
Looking good. Waiting for the sun to come up and the solar to kick in for a full test cycle |
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 like its working as expected 👍
Please fix the bare excepts in the upstream lib in a followup.
Thanks!
awesome, thanks @bdraco for testing! |
How do we get access to this bugfix? Is there any configuration or is it transparent to the user? |
@wjhrdy It'll be in the next release or you could take the files changed and put them in your installation |
So not in new 2021.12.10 update just installed? |
2022.02 |
Proposed change
Adds the last_reset attribute for trend sensors. This prevents them from showing a large spike at the start of the day
A small update was needed for the sense api library to allow the date to be passed to fix a problem with the last_reset not being set correctly if the timezone of the HA machine didn't match.
https://github.com/scottbonline/sense/releases/tag/0.9.4
https://github.com/scottbonline/sense/releases/tag/0.9.5
https://github.com/scottbonline/sense/releases/tag/0.9.6
scottbonline/sense@0.9.3...0.9.6
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: