1 """Demo platform that offers a fake siren device."""
3 from __future__
import annotations
12 SUPPORT_FLAGS = SirenEntityFeature.TURN_OFF | SirenEntityFeature.TURN_ON
17 config_entry: ConfigEntry,
18 async_add_entities: AddEntitiesCallback,
20 """Set up the Demo siren devices config entry."""
25 name=
"Siren with all features",
26 available_tones=[
"fire",
"alarm"],
27 support_volume_set=
True,
28 support_duration=
True,
35 """Representation of a demo siren device."""
40 available_tones: list[str | int] |
None =
None,
41 support_volume_set: bool =
False,
42 support_duration: bool =
False,
45 """Initialize the siren device."""
50 if available_tones
is not None:
52 if support_volume_set:
59 """Turn the siren on."""
64 """Turn the siren off."""
None __init__(self, str name, list[str|int]|None available_tones=None, bool support_volume_set=False, bool support_duration=False, bool is_on=True)
None async_turn_off(self, **Any kwargs)
None async_turn_on(self, **Any kwargs)
None async_write_ha_state(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)