Correct calls to super class in ZWaveConfigParameterSensor (#94925)

pull/94945/head
Erik Montnemery 2023-06-20 22:58:34 +02:00 committed by GitHub
parent a4399a4cb6
commit 3c34e18130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

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