Browse Source

Siren: support turn on/off if the siren has a switch

Currently turn on/off is only defined by the tone dp being available,
but it should also be available if there is a switch dp.

Issue #3002
Jason Rumney 11 tháng trước cách đây
mục cha
commit
2c593286b2
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      custom_components/tuya_local/siren.py

+ 3 - 0
custom_components/tuya_local/siren.py

@@ -61,6 +61,9 @@ class TuyaLocalSiren(TuyaLocalEntity, SirenEntity):
             support |= SirenEntityFeature.VOLUME_SET
         if self._duration_dp:
             support |= SirenEntityFeature.DURATION
+        if self._switch_dp:
+            support |= SirenEntityFeature.TURN_ON | SirenEntityFeature.TURN_OFF
+
         self._attr_supported_features = support
 
     @property