diff --git a/homeassistant/components/plugwise/binary_sensor.py b/homeassistant/components/plugwise/binary_sensor.py index 1fd40691506..bf72d9edc31 100644 --- a/homeassistant/components/plugwise/binary_sensor.py +++ b/homeassistant/components/plugwise/binary_sensor.py @@ -36,7 +36,7 @@ async def async_setup_entry( api = hass.data[DOMAIN][config_entry.entry_id]["api"] coordinator = hass.data[DOMAIN][config_entry.entry_id][COORDINATOR] - entities = [] + entities: list[BinarySensorEntity] = [] is_thermostat = api.single_master_thermostat() all_devices = api.get_all_devices() diff --git a/homeassistant/components/plugwise/gateway.py b/homeassistant/components/plugwise/gateway.py index 8cf007ca82c..af4472ac7ae 100644 --- a/homeassistant/components/plugwise/gateway.py +++ b/homeassistant/components/plugwise/gateway.py @@ -36,6 +36,7 @@ from homeassistant.helpers.update_coordinator import ( ) from .const import ( + API, COORDINATOR, DEFAULT_PORT, DEFAULT_SCAN_INTERVAL, @@ -147,9 +148,12 @@ async def async_setup_entry_gw(hass: HomeAssistant, entry: ConfigEntry) -> bool: async def _update_listener(hass: HomeAssistant, entry: ConfigEntry): """Handle options update.""" coordinator = hass.data[DOMAIN][entry.entry_id][COORDINATOR] - coordinator.update_interval = timedelta( - seconds=entry.options.get(CONF_SCAN_INTERVAL) - ) + update_interval = entry.options.get(CONF_SCAN_INTERVAL) + if update_interval is None: + api = hass.data[DOMAIN][entry.entry_id][API] + update_interval = DEFAULT_SCAN_INTERVAL[api.smile_type] + + coordinator.update_interval = timedelta(seconds=update_interval) async def async_unload_entry_gw(hass: HomeAssistant, entry: ConfigEntry): diff --git a/homeassistant/components/plugwise/sensor.py b/homeassistant/components/plugwise/sensor.py index 436f5384362..9307cb3f98f 100644 --- a/homeassistant/components/plugwise/sensor.py +++ b/homeassistant/components/plugwise/sensor.py @@ -61,7 +61,7 @@ ATTR_PRESSURE = [ SensorStateClass.MEASUREMENT, ] -TEMP_SENSOR_MAP = { +TEMP_SENSOR_MAP: dict[str, list] = { "setpoint": ATTR_TEMPERATURE, "temperature": ATTR_TEMPERATURE, "intended_boiler_temperature": ATTR_TEMPERATURE, @@ -71,7 +71,7 @@ TEMP_SENSOR_MAP = { "return_temperature": ATTR_TEMPERATURE, } -ENERGY_SENSOR_MAP = { +ENERGY_SENSOR_MAP: dict[str, list] = { "electricity_consumed": [ "Current Consumed Power", POWER_WATT, @@ -194,7 +194,7 @@ ENERGY_SENSOR_MAP = { ], } -MISC_SENSOR_MAP = { +MISC_SENSOR_MAP: dict[str, list] = { "battery": ATTR_BATTERY_LEVEL, "illuminance": ATTR_ILLUMINANCE, "modulation_level": [ @@ -234,7 +234,7 @@ async def async_setup_entry( api = hass.data[DOMAIN][config_entry.entry_id]["api"] coordinator = hass.data[DOMAIN][config_entry.entry_id][COORDINATOR] - entities = [] + entities: list[SmileSensor] = [] all_devices = api.get_all_devices() single_thermostat = api.single_master_thermostat() for dev_id, device_properties in all_devices.items(): diff --git a/mypy.ini b/mypy.ini index 4349373afca..e0edd5c006c 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2158,9 +2158,6 @@ ignore_errors = true [mypy-homeassistant.components.plex.*] ignore_errors = true -[mypy-homeassistant.components.plugwise.*] -ignore_errors = true - [mypy-homeassistant.components.profiler.*] ignore_errors = true diff --git a/script/hassfest/mypy_config.py b/script/hassfest/mypy_config.py index 9a965ae63cd..3e7b252310c 100644 --- a/script/hassfest/mypy_config.py +++ b/script/hassfest/mypy_config.py @@ -61,7 +61,6 @@ IGNORED_MODULES: Final[list[str]] = [ "homeassistant.components.ozw.*", "homeassistant.components.philips_js.*", "homeassistant.components.plex.*", - "homeassistant.components.plugwise.*", "homeassistant.components.profiler.*", "homeassistant.components.ring.*", "homeassistant.components.solaredge.*",