1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Correct calls to super class in ZWaveConfigParameterSensor (#94925)

This commit is contained in:
Erik Montnemery
2023-06-20 22:58:34 +02:00
committed by GitHub
parent a4399a4cb6
commit 3c34e18130

View File

@@ -769,8 +769,9 @@ class ZWaveConfigParameterSensor(ZWaveListSensor):
@property
def device_class(self) -> SensorDeviceClass | None:
"""Return sensor device class."""
if (device_class := super(ZwaveSensor, self).device_class) is not None:
return device_class
# mypy doesn't know about fget: https://github.com/python/mypy/issues/6185
if (device_class := ZwaveSensor.device_class.fget(self)) is not None: # type: ignore[attr-defined]
return device_class # type: ignore[no-any-return]
if (
self._primary_value.configuration_value_type
== ConfigurationValueType.ENUMERATED