Add common entity module to pylint plugin (#138706)

* Add common entity module to pylint plugin

* Fix pylint errors
This commit is contained in:
epenet 2025-02-17 14:45:32 +01:00 committed by GitHub
parent d8d054e7dd
commit 7e388f69b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

View File

@ -106,7 +106,7 @@ class ISYNodeEntity(ISYEntity):
return getattr(self._node, TAG_ENABLED, True)
@property
def extra_state_attributes(self) -> dict:
def extra_state_attributes(self) -> dict[str, Any]:
"""Get the state attributes for the device.
The 'aux_properties' in the pyisy Node class are combined with the
@ -189,7 +189,7 @@ class ISYProgramEntity(ISYEntity):
self._actions = actions
@property
def extra_state_attributes(self) -> dict:
def extra_state_attributes(self) -> dict[str, Any]:
"""Get the state attributes for the device."""
attr = {}
if self._actions:

View File

@ -61,7 +61,7 @@ class SwitchbotEntity(
return self.coordinator.device.parsed_data
@property
def extra_state_attributes(self) -> Mapping[Any, Any]:
def extra_state_attributes(self) -> Mapping[str, Any]:
"""Return the state attributes."""
return {"last_run_success": self._last_run_success}

View File

@ -1410,6 +1410,16 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
],
),
],
"entity": [
ClassTypeHintMatch(
base_class="Entity",
matches=_ENTITY_MATCH,
),
ClassTypeHintMatch(
base_class="RestoreEntity",
matches=_RESTORE_ENTITY_MATCH,
),
],
"fan": [
ClassTypeHintMatch(
base_class="Entity",