43 Commits
Author SHA1 Message Date
thatguygriff e3d6872773 Merge pull request 'chore: drop HACS distribution and move CI to Gitea' (#6) from chore/drop-hacs-gitea-ci into main
CI / Lint (push) Successful in 13s
CI / Validate integration (push) Successful in 26s
Reviewed-on: #6
Reviewed-by: James Griffin-Allwood <[email protected]>
v0.2.1
2026-09-19 13:18:23 +00:00
Kydoimosandanthropic/claude-opus-5 706580fab2 chore: drop HACS distribution and move CI to Gitea
CI / Validate integration (pull_request) Successful in 40s
CI / Lint (pull_request) Successful in 49s
The GitHub mirror is gone, so the HACS packaging and the GitHub-only CI
no longer have anything to run against.

Remove hacs.json and the .github/ workflow. Both of its jobs (hassfest
and hacs/action) were gated on `github.server_url == 'https://github.com'`
and are GitHub-hosted actions, so neither can run on the Gitea runner.

Replace them with .gitea/workflows/ci.yml:
  - lint: ruff check + ruff format --check, version pinned because ruff's
    default rule set and formatter output move between releases
  - validate: byte-compile, then scripts/validate_integration.py, which
    covers the part of hassfest that matters for a manually installed
    custom component (manifest keys, domain/directory agreement, and
    translations matching strings.json key for key)

README now documents manual installation only, and points at the local
CI commands. manifest.json documentation and issue_tracker point at the
Gitea repo; NOTICE keeps its upstream attribution.

Adopting ruff surfaced two real defects, fixed here:
  - climate.async_set_hvac_mode raised HomeAssistantError for an
    unsupported mode from inside a try that catches Exception, so the
    message was re-wrapped as "Failed to set HVAC mode: Unsupported HVAC
    mode: ...". The validation is now hoisted above the try.
  - config_flow.async_step_reauth_confirm swallowed unexpected exceptions
    into a bare "unknown" error with no log, unlike the user step. It now
    logs via _LOGGER.exception.

Remaining changes are mechanical: import ordering, docstrings on public
methods, ClassVar on mutable class attributes, contextlib.suppress, and
asyncio.TimeoutError -> TimeoutError (an alias since 3.11). The smoke
test now reads the new DknCloudNaClient.socket_connected property rather
than reaching into _socket.

Co-authored-by: anthropic/claude-opus-5
2026-09-19 10:09:11 -03:00
thatguygriff d6e935e8d7 Merge pull request 'fix(climate): write mode-correct setpoints and stop REST reverting live state' (#5) from fix/setpoint-key-and-stale-rest-state into main
Validate / Hassfest validation (push) Skipped
Validate / HACS validation (push) Skipped
Reviewed-on: #5
Reviewed-by: James Griffin-Allwood <[email protected]>
2026-09-19 12:53:51 +00:00
Kydoimosandanthropic/claude-opus-5 3929546ea5 fix(climate): write mode-correct setpoints and stop REST reverting live state
Validate / HACS validation (pull_request) Skipped
Validate / Hassfest validation (pull_request) Skipped
Two independent bugs made a second change (e.g. adjusting the target
temperature right after switching cool -> heat) fail to take, and made
Home Assistant settle back on a previous state while DKN Cloud NA showed
the correct one.

Wrong setpoint key on write:

_writable_temperature_property_for_mode() ignored its hvac_mode argument
and resolved the key from real_mode/mode in the cached device payload.
That payload still describes the pre-change state, so a heat setpoint was
emitted as setpoint_air_cool: the unit switched to heat but the heat
setpoint never moved. The same defect broke AUTO in steady state, where
real_mode=cool made the write target setpoint_air_cool while the read
used setpoint_air_auto, so the value could never appear to change.

target_temperature() and writable_target_temperature_key() now accept the
mode the caller intends, and that mode takes priority over anything in the
device payload. Device-reported modes remain a fallback only for payloads
that do not expose the requested mode's setpoint.

async_set_temperature() no longer re-sends power+mode; async_set_hvac_mode()
already sent them, and the stale-cache condition guarding the resend was
always true. It now waits (bounded) for the cloud to echo the mode before
sending the setpoint, matching the ensure_mode ordering the smoke test uses.

REST snapshot reverting live state:

The coordinator merged {**existing, **device}, letting the lagging REST
/installations snapshot win over live Socket.IO pushes. Once the socket
confirmed a write, _reconcile_optimistic dropped the overlay, leaving
nothing to stop the next poll from reverting the state.

Socket-pushed values are now tracked per device and applied after the REST
payload. They are discarded when the socket session changes, since updates
may have been missed while it was down and REST becomes authoritative again.

Also report hvac_action and target_temperature against the effective
(optimistic-aware) mode so the action cannot contradict the reported mode
while a change propagates.

Co-authored-by: anthropic/claude-opus-5
2026-09-19 09:48:10 -03:00
thatguygriff 41a05a1a69 Add license to repo
Validate / Hassfest validation (push) Has been skipped
Validate / HACS validation (push) Has been skipped
2026-07-05 10:07:37 -03:00
thatguygriff b01e200fb3 Update HACS instructions
Validate / Hassfest validation (push) Has been skipped
Validate / HACS validation (push) Has been skipped
2026-05-27 10:03:35 -03:00
thatguygriffandClaude Opus 4.7 8f39bebcc4 chore: bump version to 0.2.0
Validate / Hassfest validation (push) Has been skipped
Validate / HACS validation (push) Has been skipped
Co-Authored-By: Claude Opus 4.7 <[email protected]>
v0.2.0
2026-05-27 09:58:14 -03:00
thatguygriff 2770eda23b Merge pull request 'fix(climate): keep optimistic state until DKN cloud catches up' (#4) from fix/climate-state-revert into main
Validate / Hassfest validation (push) Has been skipped
Validate / HACS validation (push) Has been skipped
Reviewed-on: #4
2026-05-27 12:53:08 +00:00
thatguygriffandClaude Opus 4.7 494c6df2c3 fix(climate): keep optimistic state until DKN cloud catches up
Validate / Hassfest validation (pull_request) Has been skipped
Validate / HACS validation (pull_request) Has been skipped
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 <[email protected]>
2026-05-27 09:49:04 -03:00
thatguygriff d8bcd9195c Merge pull request 'Skip validate workflow on ARM64 runners' (#3) from ci/skip-on-arm into main
Validate / Hassfest validation (push) Has been skipped
Validate / HACS validation (push) Has been skipped
Reviewed-on: #3
2026-05-26 14:06:48 +00:00
thatguygriff 86d3a45877 ci: gate validate jobs on github.server_url instead of runner.arch
Validate / Hassfest validation (pull_request) Has been skipped
Validate / HACS validation (pull_request) Has been skipped
The runner.arch context isn't populated for job-level if conditions
on Gitea Actions, so the previous guard didn't skip on ARM64 Gitea
runners. Switch to checking github.server_url, which is reliably
'https://github.com' on GitHub-hosted runs and the Gitea host
everywhere else.
2026-05-26 11:06:23 -03:00
thatguygriff 5618ecf3fc ci: skip validate workflow on ARM64 runners
Validate / Hassfest validation (pull_request) Failing after 3s
Validate / HACS validation (pull_request) Failing after 3s
The hassfest and HACS validator actions both depend on amd64-only
Docker images (ghcr.io/home-assistant/hassfest, hacs/action). On
ARM64 runners — like the Gitea Actions instance hosting this fork —
those images pull but fail with "exec format error" because no
multi-arch image is published.

Validation still runs on GitHub's amd64 ubuntu-latest runners, where
it actually matters for HACS distribution.
2026-05-26 11:03:00 -03:00
thatguygriff 2248b7197a Merge pull request 'Update README to reflect implemented functionality' (#2) from docs/update-readme into main
Validate / Hassfest validation (push) Failing after 3s
Validate / HACS validation (push) Failing after 3s
Reviewed-on: #2
2026-05-26 13:42:02 +00:00
thatguygriff a7ceca779b Update README to reflect implemented functionality
Validate / Hassfest validation (pull_request) Failing after 29s
Validate / HACS validation (pull_request) Failing after 27s
The "Known Limitations & Roadmap" section claimed device control
was not implemented and that Socket.IO was unused. Both are now
inaccurate — climate control (mode, temperature, fan speed, swing)
ships via Socket.IO machine events, and live device-data updates
come over the same socket connection.

Replace that section with a "How It Works" overview and a smaller
"Known Limitations" list reflecting the actual remaining gaps.
2026-05-26 10:10:53 -03:00
thatguygriff bff10aadb5 Merge pull request 'Treat 404 as auth error and persist refreshed tokens' (#1) from fix/token-refresh-404 into main
Validate / Hassfest validation (push) Failing after 1s
Validate / HACS validation (push) Failing after 0s
Reviewed-on: #1
2026-05-26 13:08:18 +00:00
thatguygriff dd1cc76580 Treat 404 as auth error and persist refreshed tokens
Validate / Hassfest validation (pull_request) Failing after 20s
Validate / HACS validation (pull_request) Failing after 0s
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.
2026-05-26 09:58:57 -03:00
Sebastien Lavoie aa81851243 resimplify 2026-03-30 20:49:57 -04:00
Sebastien Lavoie 04e1d488f9 Dynamic fan speeds 2026-03-30 20:35:13 -04:00
Sebastien Lavoie 0dab86d205 Send + ack 2026-03-30 10:07:01 -04:00
Sebastien Lavoie 9582cb0665 Fix incorrect data 2026-03-30 08:43:37 -04:00
Sebastien Lavoie 7f8bc63c62 Smoke test 2026-03-30 08:07:20 -04:00
Sebastien Lavoie f7aa9ac00f Fix socket connection 2026-03-29 10:06:16 -04:00
Sebastien Lavoie f805015b74 Implement write actions 2026-03-29 09:52:40 -04:00
Sebastien Lavoie 1e1df6a2e7 Implement socket connection 2026-03-29 09:40:54 -04:00
Sebastien Lavoie 39b8ef3f3b fix: remove invalid climate callback decorator 2026-03-29 09:28:23 -04:00
Sebastien Lavoie 8a4d040bac fix: implement DKN Cloud NA authentication 2026-03-29 09:22:43 -04:00
Sebastien LavoieandClaude Sonnet 4.6 c9307b5c5b feat: add brand icons (256x256 and 512x512)
Daikin-blue rounded square with white snowflake motif.
Satisfies HACS brands check and HA integrations UI display.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-29 09:13:32 -04:00
Sebastien Lavoie a849133009 docs: add README with installation and entity reference 2026-03-29 08:58:32 -04:00
Sebastien LavoieandClaude Sonnet 4.6 fca5c51206 feat: add translations and entity strings
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-29 08:58:27 -04:00
Sebastien LavoieandClaude Sonnet 4.6 56e9a80492 feat: add integration entry point
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-29 08:56:53 -04:00
Sebastien Lavoie a45258ea6e feat: add config flow with user, token_display, options, and reauth steps 2026-03-29 08:55:02 -04:00
Sebastien LavoieandClaude Sonnet 4.6 ddd5b9f92c feat: add sensor and binary_sensor entity stubs
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-29 08:53:03 -04:00
Sebastien LavoieandClaude Sonnet 4.6 515db83f19 fix: remove unused ATTR_TEMPERATURE import, add @callback to supported_features
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-29 08:52:00 -04:00
Sebastien Lavoie 54265f326e feat: add DknClimateEntity stub 2026-03-29 08:50:23 -04:00
Sebastien LavoieandClaude Sonnet 4.6 8c1c25a1a9 refactor: fix inner asyncio import and expose entry_id publicly on coordinator
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-29 08:49:00 -04:00
Sebastien Lavoie 60f7e1e980 feat: add DknEntity base with locks, overlays, and refresh 2026-03-29 08:47:34 -04:00
Sebastien Lavoie 8ba33ebd85 feat: add DknCoordinator 2026-03-29 08:46:08 -04:00
Sebastien Lavoie 0beaa71fdc feat: add DknCloudNaClient stub 2026-03-29 08:44:43 -04:00
Sebastien Lavoie 17e44e4546 feat: add manifest.json and constants 2026-03-29 08:43:05 -04:00
Sebastien Lavoie 29fa4d63f6 fix: add checkout to HACS job and set contents:read permission 2026-03-29 08:42:16 -04:00
Sebastien Lavoie d145b117f2 feat: add HACS and hassfest CI validation 2026-03-29 08:40:43 -04:00
Sebastien LavoieandClaude Sonnet 4.6 09f21c4ea4 docs: add scaffolding implementation plan
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-29 08:38:23 -04:00
Sebastien LavoieandClaude Sonnet 4.6 6c327fbac5 Add design doc for DKN Cloud NA HACS integration scaffolding
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-29 08:34:49 -04:00