tache / homeassistant-kidde

A custom component for Kidde HomeSafe.
MIT License
25 stars 3 forks source link

BUG: Use correct return deviceclass and stateclass for sensors #1

Closed carterbox closed 3 months ago

carterbox commented 3 months ago

@tache, are you interested in becoming the lead fork for this project? If so, you should enable issues and actions on this repo?

When running this integration, I noticed that the history of some of the sensors could not be viewed correctly. e.g. the smoke levels showed as a state history instead of as a line. This PR fixes that by adding explicit stateclasses and deviceclasses to the sensors, so that the data can be correctly rendered using standard homeassistant UI elements.

As part of this, I also defined a new sensor for the timestamp sensors which converts the string returned by the kidde API into a python datetime. This allows homeassistant to display relative times like "last seen 5 minutes ago" instead of just showing the timestamp.

tache commented 3 months ago

Okay, just saw the note on the repo. We can make this the lead fork.

tache commented 3 months ago

I moded the hacs.json and manifest.json to increment for the release. Did you do that just for developing? Or is it better to have it not increment for HACS?

carterbox commented 3 months ago

I moded the hacs.json and manifest.json to increment for the release. Did you do that just for developing? Or is it better to have it not increment for HACS?

Yes. I did made these changes for development purposes. This is my first self-published package for HACS, so I was playing with some of the params.

The release action in this repo overwrites the version number in manifest.json before creating the release zip, so in theory it doesn't matter what number is there.

Also, I wasn't able to install un-versioned versions of his HAC (e.g. from the main branch) to my Homeassistant Instance. Only the zipped releases worked for me.