Skip to content

Claude/dscript module stability 1lr552 - #1

Merged
mk-maddin merged 9 commits into
masterfrom
claude/dscript-module-stability-1lr552
Oct 10, 2026
Merged

mk-maddin merged 9 commits into
masterfrom
claude/dscript-module-stability-1lr552

Conversation

@mk-maddin

Copy link
Copy Markdown
Owner

No description provided.

claude and others added 9 commits October 5, 2026 18:47
- Create dScriptBoardHA (reverse DNS + GetStatus + GetConfig over
  blocking sockets) in an executor instead of the event loop.
- Add async_check_available(); heartbeats only run a lightweight
  GetStatus (config changes are detected by ValidateBoardConfig right
  after - before, the full InitBoard updated the counts first so new
  entities were never detected) and the board sensor uses the async
  check as well.
- Availability checks reset the firmware marker first so a board that
  stops answering is actually reported unavailable; check_available
  returns True on success (heartbeats logged "unavailable" every time).
- Board sensor polls the web page via the shared aiohttp session with a
  10s timeout and always closes the connection (urlopen had no timeout
  and leaked connections on the board).
- Await and import async_dScript_GetEntityByUniqueID in
  ValidateBoardConfig (was an undefined name).
- Require dScriptModule>=3.5.0 (request serialization, timeouts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVLmxv3Hbmdd6Nzf6zPp3p
- manifest.json: config_flow must be a boolean, keys sorted as required
  by hassfest, add issue_tracker.
- services.yaml: "dscription" typos made the file invalid; the entity
  selector of updatebutton had integration and domain swapped.
- hacs.json: remove iot_class (not a hacs.json key, belongs to manifest).
- Options flow: do not assign config_entry on HA versions that provide
  it as a property (raises AttributeError since HA 2025.12, the options
  dialog could not be opened).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVLmxv3Hbmdd6Nzf6zPp3p
- validate.yml: hassfest and HACS action (brands check ignored until
  the integration is listed in home-assistant/brands).
- tests.yml: pytest with pytest-homeassistant-custom-component.
- Tests: config/options flow, setup/unload with the integrated
  dScriptServer, end-to-end with an emulated board (heartbeat creates
  entities, light control, push updates, no duplicate entities on
  repeated heartbeats, requests to a board are never parallel).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVLmxv3Hbmdd6Nzf6zPp3p
The debug message at the end of the availability check had 10
placeholders but 9 arguments. With debug logging enabled (as in the
GitHub workflow) pytest raises on such formatting errors, so board setup
and entry unload aborted; in production the log lines were lost. Same
for the unload listener message and the heartbeat service messages.

- pytest.ini: log_level = DEBUG so local runs behave like CI
- tests/test_logging_calls.py checks all logging calls via AST

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVLmxv3Hbmdd6Nzf6zPp3p
- The board sensor polls the small page status.htm (firmware >= 3.9)
  instead of index.htm. It carries temperature, voltage and load, so
  the extra GetStatus connection every 10th poll is no longer needed.
  Boards without the page (404) fall back to index.htm + GetStatus as
  before; status.htm is retried every 20 polls (firmware update).
- New diagnostic sensors per board, disabled by default: temperature,
  voltage and load (dScript instructions/s, maximum of the last minute,
  attribute last_second). They are updated via a dispatcher signal of
  the board sensor (no own polling, no extra connection). The existing
  attributes of the board sensor are unchanged.
- Tests for the status page and the fallback on older firmware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVLmxv3Hbmdd6Nzf6zPp3p
17 .pyc files were committed although .gitignore excludes __pycache__/;
they changed with every local Python run. Files stay on disk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVLmxv3Hbmdd6Nzf6zPp3p
- Temperature and voltage are separate diagnostic sensors now, the
  duplicate attributes of the board sensor are removed.
- sw_version / firmware attributes are read live from the board object
  (were fixed at entity creation, stale after a firmware update).
- status.htm also updates the app version, as the former GetStatus on
  every 10th poll did (that GetStatus only refreshed module id,
  versions, voltage and temperature; entity counts come from GetConfig
  on every heartbeat and are not affected).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVLmxv3Hbmdd6Nzf6zPp3p
@mk-maddin
mk-maddin merged commit 700569c into master Oct 10, 2026
6 checks passed
@mk-maddin
mk-maddin deleted the claude/dscript-module-stability-1lr552 branch October 10, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants