Sfoglia il codice sorgente

siren: simplify the way available_tones is used

Siren used to force the use of SirenEntityDescriptor to set available_tones,
but now has the simpler option of setting _attr_available_tones, like any
other entity.  Use that.

Issue #705
Jason Rumney 2 anni fa
parent
commit
775574bf8a
1 ha cambiato i file con 1 aggiunte e 3 eliminazioni
  1. 1 3
      custom_components/tuya_local/siren.py

+ 1 - 3
custom_components/tuya_local/siren.py

@@ -3,7 +3,6 @@ Setup for Tuya siren devices
 """
 from homeassistant.components.siren import (
     SirenEntity,
-    SirenEntityDescription,
     SirenEntityFeature,
 )
 
@@ -48,8 +47,7 @@ class TuyaLocalSiren(TuyaLocalEntity, SirenEntity):
                 | SirenEntityFeature.TURN_ON
                 | SirenEntityFeature.TURN_OFF
             )
-            self.entity_description = SirenEntityDescription
-            self.entity_description.available_tones = [
+            self._attr_available_tones = [
                 x for x in self._tone_dp.values(device) if x != "off"
             ]
             self._default_tone = self._tone_dp.default()