cyberjunky / home-assistant-toon_climate

This component provides a climate device for rooted Toon thermostats.
MIT License
32 stars 8 forks source link

Input validation added #29

Closed rbak69 closed 3 years ago

rbak69 commented 3 years ago

Added input validation to ensure requests to change the hvac mode, active preset or target temperature are only accepted and processed if they are within the defined ranges.

For hvac and preset this is defined in the code itself (SUPPORT_MODES and SUPPORT_PRESETS).

For the target temperature this is partly defined by the code (the hard limits DEFAULT_MIN_TEMP and DEFAULT_MAX_TEMP) and the limits defined by the home assistant configuration (the configuration parameters "min_temp" and "max_temp"). In case the config is set outside of the hard limits the respective hard limit will prevail above the config parameter.

rbak69 commented 3 years ago

@cyberjunky and @IgorYbema I am quite happy with the current version of the code. Based on the knowledge I have I believe it is now a very robust custom component with the right level of info in the logging.

However I would like your opinion and support on the following: I know the newer Toon 2 version has some additional sensors. Based on the information I have seen those sensors are exposed in a different way.

Where for the standard Toon information (both Toon 1 and Toon 2) we can use "http://:/happ_thermstat?action=getThermostatInfo". It seems that for the Toon 2 we can only get information for the additional sensors using "http://:/tsc/sensors".

Do you know whether the "http://:/happ_thermstat?action=getThermostatInfo" is a default web service provided by the Toon itself? Or has this been developed by the Toon Software Collective. With other words could this webservice be extended to also provide the information for the additional Toon 2 sensors or do we indeed need to use "http://:/tsc/sensors" to ensure we do not interfere with standard Toon firmware releases? @IgorYbema I believe you are part of the TSC so would you be able to answer this or know who can?

Either way I am intersted in adding the additional Toon 2 sensors in this custom component as well. However I do not own a Toon 2 yet and currently do not have access to a Rooted Toon 2 to develop and test this further. Will see whether I can get my hands on a Toon 2 on any of the Dutch market places. In case you own a Toon 2 maybe you can support with the currect code to create the correct API request and parsing of the result so we can return that as user data with the custom toon climate component.

Toon climate component hassio

This way the sensors can be defined in the same way whether it is for the basisc toon details as well as the additional Toon 2 sensors.