mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Correct typing in bsblan and activate mypy (#53153)
This commit is contained in:
parent
3d40fdf2c6
commit
d4589894fe
@ -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
|
||||
|
@ -1,26 +1,27 @@
|
||||
"""Constants for the BSB-Lan integration."""
|
||||
from typing import Final
|
||||
|
||||
DOMAIN = "bsblan"
|
||||
|
||||
DATA_BSBLAN_CLIENT = "bsblan_client"
|
||||
DATA_BSBLAN_TIMER = "bsblan_timer"
|
||||
DATA_BSBLAN_UPDATED = "bsblan_updated"
|
||||
DATA_BSBLAN_CLIENT: Final = "bsblan_client"
|
||||
DATA_BSBLAN_TIMER: Final = "bsblan_timer"
|
||||
DATA_BSBLAN_UPDATED: Final = "bsblan_updated"
|
||||
|
||||
ATTR_IDENTIFIERS = "identifiers"
|
||||
ATTR_MODEL = "model"
|
||||
ATTR_MANUFACTURER = "manufacturer"
|
||||
ATTR_IDENTIFIERS: Final = "identifiers"
|
||||
ATTR_MODEL: Final = "model"
|
||||
ATTR_MANUFACTURER: Final = "manufacturer"
|
||||
|
||||
ATTR_TARGET_TEMPERATURE = "target_temperature"
|
||||
ATTR_INSIDE_TEMPERATURE = "inside_temperature"
|
||||
ATTR_OUTSIDE_TEMPERATURE = "outside_temperature"
|
||||
ATTR_TARGET_TEMPERATURE: Final = "target_temperature"
|
||||
ATTR_INSIDE_TEMPERATURE: Final = "inside_temperature"
|
||||
ATTR_OUTSIDE_TEMPERATURE: Final = "outside_temperature"
|
||||
|
||||
ATTR_STATE_ON = "on"
|
||||
ATTR_STATE_OFF = "off"
|
||||
ATTR_STATE_ON: Final = "on"
|
||||
ATTR_STATE_OFF: Final = "off"
|
||||
|
||||
CONF_DEVICE_IDENT = "device_identification"
|
||||
CONF_CONTROLLER_FAM = "controller_family"
|
||||
CONF_CONTROLLER_VARI = "controller_variant"
|
||||
CONF_DEVICE_IDENT: Final = "device_identification"
|
||||
CONF_CONTROLLER_FAM: Final = "controller_family"
|
||||
CONF_CONTROLLER_VARI: Final = "controller_variant"
|
||||
|
||||
SENSOR_TYPE_TEMPERATURE = "temperature"
|
||||
SENSOR_TYPE_TEMPERATURE: Final = "temperature"
|
||||
|
||||
CONF_PASSKEY = "passkey"
|
||||
CONF_PASSKEY: Final = "passkey"
|
||||
|
3
mypy.ini
3
mypy.ini
@ -1103,9 +1103,6 @@ ignore_errors = true
|
||||
[mypy-homeassistant.components.bmw_connected_drive.*]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.bsblan.*]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.cert_expiry.*]
|
||||
ignore_errors = true
|
||||
|
||||
|
@ -26,7 +26,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
||||
"homeassistant.components.azure_event_hub.*",
|
||||
"homeassistant.components.blueprint.*",
|
||||
"homeassistant.components.bmw_connected_drive.*",
|
||||
"homeassistant.components.bsblan.*",
|
||||
"homeassistant.components.cert_expiry.*",
|
||||
"homeassistant.components.climacell.*",
|
||||
"homeassistant.components.cloud.*",
|
||||
|
Loading…
x
Reference in New Issue
Block a user