Add control entities: box to-do list, skip switch, donate button, subscriptions
Validate / hassfest (push) Failing after 6s
Validate / pytest (push) Failing after 8s
Validate / HACS (push) Failing after 1m8s

The to-do list exists so Home Assistant's own conversation agent can manage the
order through HassListAddItem rather than through anything bespoke. Skip is a
switch because skipped/not-skipped is state worth reading back; donate is a
button because it cannot be undone. Un-skip raises rather than guessing at an
endpoint that has never been observed.

Fixes subscription parsing, which matched the heading row and so reported zero
on an account that has one.
This commit is contained in:
flan
2026-08-03 20:13:32 +00:00
parent 213c16d98e
commit 551d3240a2
14 changed files with 592 additions and 14 deletions
@@ -9,6 +9,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .actions import FreshHarvestActions
from .api import (
AccountSnapshot,
FreshHarvestAuthError,
@@ -34,10 +35,15 @@ class FreshHarvestCoordinator(DataUpdateCoordinator[AccountSnapshot]):
config_entry=entry,
)
self.client = client
self.actions = FreshHarvestActions(client)
async def _async_update_data(self) -> AccountSnapshot:
try:
return await self.client.async_get_snapshot()
snapshot = await self.client.async_get_snapshot()
# Two extra pages per refresh, so three requests every six hours.
snapshot.subscriptions = await self.actions.async_list_subscriptions()
snapshot.vacation_holds = await self.actions.async_list_vacation_holds()
return snapshot
except FreshHarvestAuthError as err:
raise ConfigEntryAuthFailed(str(err)) from err
except FreshHarvestError as err: