Make spa entities unavailable when the spa is not reporting
A module that is online but cut off from the control box keeps serving and publishing a full document of blank and default values. Read literally that is an idle spa: no temperatures, salt level 0, lights and jets off, and controls that accept a value and snap back. - The spa counts as reporting only while telemetry is fresh (something arrived in the last five minutes) and carries control-box data. Otherwise every entity is unavailable, and the reason is logged once per change. - The entry still loads in that state, so entities return on their own when the spa reports again. - A watchdog catches silence between updates, and reloads the entry when the broker connection stays down for three minutes. The broker is the only control path and its credentials rotate; paho reconnects with the old ones, so only a fresh sign-in recovers it. - Version 0.2.0. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ba61e9c0b
commit
298df5864a
9 files changed
+120
-9
No files matched your search
@@ -11,11 +11,11 @@ from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.device_registry import DeviceInfo
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
|
||||
from . import HotSpringConfigEntry
|
||||
from .constants import DOMAIN, MANUFACTURER
|
||||
from .coordinator import HotSpringCoordinator
|
||||
from .entity import HotSpringEntity
|
||||
|
||||
# Hot Spot spas run 80-104 F.
|
||||
MIN_TEMP_F = 80
|
||||
@@ -30,7 +30,7 @@ async def async_setup_entry(
|
||||
async_add_entities([HotSpringClimate(entry.runtime_data)])
|
||||
|
||||
|
||||
class HotSpringClimate(CoordinatorEntity[HotSpringCoordinator], ClimateEntity):
|
||||
class HotSpringClimate(HotSpringEntity, ClimateEntity):
|
||||
_attr_has_entity_name = True
|
||||
_attr_name = None # use the device name
|
||||
_attr_hvac_modes = [HVACMode.HEAT]
|
||||
|
||||
Reference in new issue
Block a user