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
This commit is contained in:
2026-09-19 10:09:11 -03:00
co-authored by anthropic/claude-opus-5
parent d6e935e8d7
commit 706580fab2
17 changed files with 461 additions and 99 deletions
+6 -11
View File
@@ -3,12 +3,12 @@
from __future__ import annotations
import asyncio
from contextlib import suppress
import importlib.util
import json
import os
import sys
from contextlib import suppress
from pathlib import Path
import sys
from typing import Any
from aiohttp import ClientSession
@@ -311,8 +311,7 @@ async def _main() -> None:
current_device["_installation_id"] = installation_id
await client.ensure_socket_connection(installations, on_data, on_refresh)
socket = client._socket # noqa: SLF001
results["socket_connect"] = bool(socket and socket.connected)
results["socket_connect"] = client.socket_connected
if not results["socket_connect"]:
raise RuntimeError("Socket.IO connection did not come up")
@@ -323,10 +322,8 @@ async def _main() -> None:
if _has_live_state(current_device):
return True
remaining = max(0.1, deadline - loop.time())
try:
with suppress(TimeoutError):
await asyncio.wait_for(queue.get(), timeout=min(2.0, remaining))
except asyncio.TimeoutError:
pass
if _has_live_state(current_device):
return True
await fetch_current_device()
@@ -349,10 +346,8 @@ async def _main() -> None:
deadline = loop.time() + timeout
while loop.time() < deadline:
remaining = max(0.1, deadline - loop.time())
try:
with suppress(TimeoutError):
await asyncio.wait_for(queue.get(), timeout=min(2.0, remaining))
except asyncio.TimeoutError:
pass
if current_device.get(property_name) == expected:
return True
await fetch_current_device()
@@ -370,7 +365,7 @@ async def _main() -> None:
payload = await asyncio.wait_for(
queue.get(), timeout=min(0.5, remaining)
)
except asyncio.TimeoutError:
except TimeoutError:
continue
deltas.append(payload)
return deltas