Additional place to use isinstance rather than do a string compare (#57094)
This commit is contained in:
parent
b024d88b36
commit
59b1433e5c
2 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue