The DKN cloud REST endpoint lags behind the unit for several seconds
after a write, even though the unit itself and the DKN app reflect
the change immediately. The previous 2.5s optimistic-overlay TTL
expired well before the cloud caught up, so the next coordinator
publish (REST poll or socket device-data push) carried stale values
and the HA UI reverted to the previous setting.
Extend the overlay TTL to 30s as a safety bound, and track the
underlying device key + expected device value alongside each overlay.
On every coordinator publish, clear overlays whose device key now
reports the expected value (cloud has confirmed). The TTL still
caps how long a silently-failed write can hold a wrong value.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The DKN Cloud NA API returns 404 (not 401) when tokens are expired,
which caused the integration to silently fail with UpdateFailed
indefinitely instead of attempting a token refresh or triggering
reauth. Refreshed tokens were also only held in memory, so they
were lost on Home Assistant restart.
- Add 404 to auth_error_statuses on is_logged_in, refresh_access_token,
and fetch_installations.
- Persist refreshed access + refresh tokens back to the config entry
after each successful coordinator update.
- Skip the entry reload listener for token-only option updates to
avoid a reload loop on every refresh.
- Log API 4xx responses at WARNING with the body so failures are
visible in HA logs without enabling debug logging.
Daikin-blue rounded square with white snowflake motif.
Satisfies HACS brands check and HA integrations UI display.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>