1 """Support for Overkiz sirens."""
5 from pyoverkiz.enums
import OverkizState
6 from pyoverkiz.enums.command
import OverkizCommand, OverkizCommandParam
18 from .
import HomeAssistantOverkizData
19 from .const
import DOMAIN
20 from .entity
import OverkizEntity
26 async_add_entities: AddEntitiesCallback,
28 """Set up the Overkiz sirens from a config entry."""
29 data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
33 for device
in data.platforms[Platform.SIREN]
38 """Representation an Overkiz Siren."""
40 _attr_supported_features = (
41 SirenEntityFeature.TURN_OFF
42 | SirenEntityFeature.TURN_ON
43 | SirenEntityFeature.DURATION
48 """Get whether the siren is in on state."""
50 self.
executorexecutor.select_state(OverkizState.CORE_ON_OFF)
51 == OverkizCommandParam.ON
55 """Send the on command."""
56 if kwargs.get(ATTR_DURATION):
57 duration = kwargs[ATTR_DURATION]
61 duration_in_ms = duration * 1000
63 await self.
executorexecutor.async_execute_command(
65 OverkizCommand.RING_WITH_SINGLE_SIMPLE_SEQUENCE,
69 OverkizCommandParam.MEMORIZED_VOLUME,
73 """Send the off command."""
74 await self.
executorexecutor.async_execute_command(OverkizCommand.OFF)
None async_turn_off(self, **Any kwargs)
None async_turn_on(self, **Any kwargs)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)