ha-wyzeapi
ha-wyzeapi copied to clipboard
[Bug] <The thermostat unit error>
The thermostat unit is not set, HA read it default as celsius and if switch HA system unit to H it shows: The state read as:
Tried to solve myself: I think the issue is self._thermostat.temp_unit is returning what my device setting. However, even though I set the temperature to Celsius, the actual data of self._thermostat.temperature is still using Fahrenheit. Also, the state doesn't show attribute temperature_unit, so I added unit_of_measurement.
@property
def temperature_unit(self) -> str:
#if self._thermostat.temp_unit != TemperatureUnit.FAHRENHEIT:
# return TEMP_CELSIUS
return TEMP_FAHRENHEIT
@property
def unit_of_measurement(self) -> str:
if self._thermostat.temp_unit != TemperatureUnit.FAHRENHEIT:
return TEMP_CELSIUS
return TEMP_FAHRENHEIT
This gave me the correct result.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.