1 """Support for the Switchbot lock."""
5 from switchbot_api
import LockCommands
12 from .
import SwitchbotCloudData
13 from .const
import DOMAIN
14 from .entity
import SwitchBotCloudEntity
20 async_add_entities: AddEntitiesCallback,
22 """Set up SwitchBot Cloud entry."""
23 data: SwitchbotCloudData = hass.data[DOMAIN][config.entry_id]
26 for device, coordinator
in data.devices.locks
31 """Representation of a SwitchBot lock."""
37 """Handle updated data from the coordinator."""
38 if coord_data := self.coordinator.data:
49 """Unlock the lock."""
None send_api_command(self, Commands command, str command_type="command", dict|str parameters="default")
None _handle_coordinator_update(self)
None async_unlock(self, **Any kwargs)
None async_lock(self, **Any kwargs)
None async_write_ha_state(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry config, AddEntitiesCallback async_add_entities)