1 """Demo platform that has two fake switches."""
3 from __future__
import annotations
18 config_entry: ConfigEntry,
19 async_add_entities: AddEntitiesCallback,
21 """Set up the demo switch platform."""
24 DemoSwitch(
"switch1",
"Decorative Lights",
True,
True),
30 translation_key=
"air_conditioner",
31 device_class=SwitchDeviceClass.OUTLET,
38 """Representation of a demo switch."""
40 _attr_has_entity_name =
True
42 _attr_should_poll =
False
50 translation_key: str |
None =
None,
51 device_class: SwitchDeviceClass |
None =
None,
53 """Initialize the Demo switch."""
60 identifiers={(DOMAIN, unique_id)},
65 """Turn the switch on."""
70 """Turn the device off."""
None __init__(self, str unique_id, str device_name, bool state, bool assumed, str|None translation_key=None, SwitchDeviceClass|None device_class=None)
None turn_on(self, **Any kwargs)
None turn_off(self, **Any kwargs)
None schedule_update_ha_state(self, bool force_refresh=False)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)