Additional place to use isinstance rather than do a string compare (#57094)

This commit is contained in:
Robert Svensson 2021-10-05 09:17:45 +02:00 committed by GitHub
parent b024d88b36
commit 59b1433e5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -149,12 +149,12 @@ class DeconzBinarySensor(DeconzDevice, BinarySensorEntity):
if self._device.secondary_temperature is not None:
attr[ATTR_TEMPERATURE] = self._device.secondary_temperature
if self._device.type in Presence.ZHATYPE:
if isinstance(self._device, Presence):
if self._device.dark is not None:
attr[ATTR_DARK] = self._device.dark
elif self._device.type in Vibration.ZHATYPE:
elif isinstance(self._device, Vibration):
attr[ATTR_ORIENTATION] = self._device.orientation
attr[ATTR_TILTANGLE] = self._device.tilt_angle
attr[ATTR_VIBRATIONSTRENGTH] = self._device.vibration_strength