1 """Support for SmartThings Cloud."""
3 from __future__
import annotations
5 from pysmartthings.device
import DeviceEntity
11 from .const
import DOMAIN, SIGNAL_SMARTTHINGS_UPDATE
15 """Defines a SmartThings entity."""
17 _attr_should_poll =
False
19 def __init__(self, device: DeviceEntity) ->
None:
20 """Initialize the instance."""
26 configuration_url=
"https://account.smartthings.com",
27 identifiers={(DOMAIN, device.device_id)},
28 manufacturer=device.status.ocf_manufacturer_name,
29 model=device.status.ocf_model_number,
31 hw_version=device.status.ocf_hardware_version,
32 sw_version=device.status.ocf_firmware_version,
36 """Device added to hass."""
38 async
def async_update_state(devices):
39 """Update device state."""
40 if self.
_device_device.device_id
in devices:
44 self.
hasshass, SIGNAL_SMARTTHINGS_UPDATE, async_update_state
48 """Disconnect the device when removed."""
def async_added_to_hass(self)
None async_will_remove_from_hass(self)
None __init__(self, DeviceEntity device)
None async_update_ha_state(self, bool force_refresh=False)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)