Creating an instance of a JsonThermostat
In contrast to the normal thermostat class needs this class constrtuctor only a settings string as argument. This argument must be based on the JSONThermostatSettings interface.
Returning if the thermostat is cooling
this message returns state of the thermostat as a boolean
Returning if the thermostat is heating
this message returns state of the thermostat as a boolean
This method checks if the given unit is one of the known units in this class
this method returns true if the unit exist and returns false if it doesnt exist
This class converts the temperature to the correct Unit using the convertTemperature class. Herefor , you must fill in the temperature and the unit argument. The Default unit is celcius
this class returns the correct covnerted temperature.
Getting temperature range
this method returns the range number
getting initialized unit
this class returns a string that contains the unit.
Getting wanted temperature
this method returns the wanted number
Setting the current temperature
this method returns current temperature number
updating the current temperature, it returns an Thermostat result object
this method returns an instance of the interface thermostatResult
you can update current temperature with this method.
this method returns an instance from the ThermostatResult Interface.
Generated using TypeDoc
JSON Thermostat Class
With this class you can create a thermostat. The difference between this class and the normal thermostat class is that this class works with json strings. To create a thermostat use the constructor and fill the argument with a json string, defined by JSONThermostatSettings interface