ha-wyzeapi icon indicating copy to clipboard operation
ha-wyzeapi copied to clipboard

[Bug] <The thermostat unit error>

Open DaiZack opened this issue 1 year ago • 1 comments

The thermostat unit is not set, HA read it default as celsius image and if switch HA system unit to H it shows: image The state read as: image

DaiZack avatar Sep 23 '22 02:09 DaiZack

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.

image image

DaiZack avatar Sep 23 '22 18:09 DaiZack

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.

github-actions[bot] avatar Aug 13 '23 01:08 github-actions[bot]