diff --git a/homeassistant/components/wirelesstag/entity.py b/homeassistant/components/wirelesstag/entity.py index daa3e3b5842..c6253fef380 100644 --- a/homeassistant/components/wirelesstag/entity.py +++ b/homeassistant/components/wirelesstag/entity.py @@ -1,6 +1,7 @@ """Support for Wireless Sensor Tags.""" import logging +from typing import Any from wirelesstagpy import SensorTag @@ -77,7 +78,7 @@ class WirelessTagBaseSensor(Entity): self._state = self.updated_state_value() @property - def extra_state_attributes(self): + def extra_state_attributes(self) -> dict[str, Any]: """Return the state attributes.""" return { ATTR_BATTERY_LEVEL: int(self._tag.battery_remaining * 100), diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index 7103abcecf0..9607c0222d9 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -683,14 +683,17 @@ _ENTITY_MATCH: list[TypeHintMatch] = [ TypeHintMatch( function_name="capability_attributes", return_type=["Mapping[str, Any]", None], + mandatory=True, ), TypeHintMatch( function_name="state_attributes", return_type=["dict[str, Any]", None], + mandatory=True, ), TypeHintMatch( function_name="extra_state_attributes", return_type=["Mapping[str, Any]", None], + mandatory=True, ), TypeHintMatch( function_name="device_info",