Correct typing in bsblan and activate mypy (#53153)

This commit is contained in:
jan iversen 2021-07-19 19:30:52 +02:00 committed by GitHub
parent 3d40fdf2c6
commit d4589894fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 22 deletions

View file

@ -25,6 +25,7 @@ from homeassistant.const import (
ATTR_TEMPERATURE,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
UnitTemperatureT,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo
@ -100,7 +101,7 @@ class BSBLanClimate(ClimateEntity):
self._hvac_mode: str | None = None
self._target_temperature: float | None = None
self._temperature_unit = None
self._preset_mode = None
self._preset_mode: str | None = None
self._store_hvac_mode = None
self._info: Info = info
self.bsblan = bsblan
@ -121,7 +122,7 @@ class BSBLanClimate(ClimateEntity):
return self._info.device_identification
@property
def temperature_unit(self) -> str:
def temperature_unit(self) -> UnitTemperatureT:
"""Return the unit of measurement which this thermostat uses."""
if self._temperature_unit == "°C":
return TEMP_CELSIUS