nigl / homeassistant_eta_integration

Integration of ETA (Heating) sensors to home assistant
MIT License
24 stars 8 forks source link

Improve parsing of float values returned by API #4

Closed civ0 closed 1 year ago

civ0 commented 1 year ago

This change improves the parsing of float values returned by the API. This is done by using the numerical value, scale factor and number of decimal places specified in the API response instead of trying to cast the string representation directly to a float. This is only done for values that can be identified as floats by their unit.

Casting the string representation directly to float caused problems when the string contained , instaed . for decimals points.

I have also mapped the units returned by the API to the corresponding SensorDeviceClass units in Homeassistant.

This PR should resolve issues #1 and #2

Vinzent82 commented 1 year ago

@civ0 I´ll install the version of your PR on my friends heating this week. In case somebody could give me a quick overview on how that integration (respectively HA integrations in general) work(0)s I could also do a code review.

civ0 commented 1 year ago

@Vinzent82 Thanks for trying it out. I already noticed that updating an existing installation of the integration does not give access to more entities, because th available entities are only generated during the first installation. I am currently trying to fix this.

I also don't have any prior experience with HA integrations, so I am not able to give a proper introduction to this topic.

Vinzent82 commented 1 year ago

@civ0 ok at least I can tell you that I was able to install your branch successfully and it works well.

nigl commented 1 year ago

@civ0 Thank you for your work. Unfortunately I haven't had time to look into your pull request earlier...