1 """Base classes for SmartTub entities."""
11 from .const
import DOMAIN
12 from .helpers
import get_spa_name
16 """Base class for SmartTub entities."""
19 self, coordinator: DataUpdateCoordinator, spa: smarttub.Spa, entity_name
21 """Initialize the entity.
23 Given a spa id and a short name for the entity, we provide basic device
24 info, name, unique id, etc. for all derived entities.
31 identifiers={(DOMAIN, spa.id)},
32 manufacturer=spa.brand,
40 """Retrieve the result of Spa.get_status()."""
42 return self.coordinator.data[self.
spaspa.id].
get(
"status")
46 """Base class for SmartTub sensors."""
48 def __init__(self, coordinator, spa, sensor_name, state_key):
49 """Initialize the entity."""
50 super().
__init__(coordinator, spa, sensor_name)
55 """Retrieve the underlying state from the spa."""
None __init__(self, DataUpdateCoordinator coordinator, smarttub.Spa spa, entity_name)
smarttub.SpaState spa_status(self)
def __init__(self, coordinator, spa, sensor_name, state_key)
web.Response get(self, web.Request request, str config_key)
str get_spa_name(smarttub.Spa spa)