1 """Base class for SwitchBot via API entities."""
5 from switchbot_api
import Commands, Device, Remote, SwitchBotAPI
10 from .const
import DOMAIN
11 from .coordinator
import SwitchBotCoordinator
15 """Representation of a SwitchBot Cloud entity."""
18 _switchbot_state: dict[str, Any] |
None =
None
19 _attr_has_entity_name =
True
24 device: Device | Remote,
25 coordinator: SwitchBotCoordinator,
27 """Initialize the entity."""
32 identifiers={(DOMAIN, device.device_id)},
33 name=device.device_name,
34 manufacturer=
"SwitchBot",
35 model=device.device_type,
41 command_type: str =
"command",
42 parameters: dict | str =
"default",
44 """Send command to device."""
45 await self.
_api_api_api.send_command(
None send_api_command(self, Commands command, str command_type="command", dict|str parameters="default")
None __init__(self, SwitchBotAPI api, Device|Remote device, SwitchBotCoordinator coordinator)