From 292feb4e246ccf8de88475ada7b95260d52fda31 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 21 Mar 2023 09:51:05 +0100 Subject: [PATCH] Enable inheritance checks on ExtraStoredData (#90021) --- homeassistant/components/zwave_js/update.py | 2 +- pylint/plugins/hass_enforce_type_hints.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/zwave_js/update.py b/homeassistant/components/zwave_js/update.py index 33cb0a1c5a8..70d12b22ded 100644 --- a/homeassistant/components/zwave_js/update.py +++ b/homeassistant/components/zwave_js/update.py @@ -132,7 +132,7 @@ class ZWaveNodeFirmwareUpdate(UpdateEntity): self._attr_device_info = get_device_info(driver, node) @property - def extra_restore_state_data(self) -> ExtraStoredData: + def extra_restore_state_data(self) -> ZWaveNodeFirmwareUpdateExtraStoredData: """Return ZWave Node Firmware Update specific state data to be restored.""" return ZWaveNodeFirmwareUpdateExtraStoredData(self._latest_version_firmware) diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index c63fde19c8e..9430158fae9 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -680,6 +680,7 @@ _RESTORE_ENTITY_MATCH: list[TypeHintMatch] = [ TypeHintMatch( function_name="extra_restore_state_data", return_type=["ExtraStoredData", None], + check_return_type_inheritance=True, ), ] _TOGGLE_ENTITY_MATCH: list[TypeHintMatch] = [