1 """Base classes for Crownstone devices."""
3 from __future__
import annotations
5 from crownstone_cloud.cloud_models.crownstones
import Crownstone
10 from .const
import CROWNSTONE_INCLUDE_TYPES, DOMAIN
14 """Base entity class for Crownstone devices."""
16 _attr_should_poll =
False
17 _attr_has_entity_name =
True
19 def __init__(self, device: Crownstone) ->
None:
20 """Initialize the device."""
25 """Return the unique identifier for this device.
27 Used as device ID and to generate unique entity ID's.
33 """Return device info."""
35 identifiers={(DOMAIN, self.
cloud_idcloud_id)},
36 manufacturer=
"Crownstone",
37 model=CROWNSTONE_INCLUDE_TYPES[self.
devicedevice.type],
38 name=self.
devicedevice.name,
39 sw_version=self.
devicedevice.sw_version,
None __init__(self, Crownstone device)
DeviceInfo device_info(self)