From 793785a34d5550cebc16d2b2b30289565936d88a Mon Sep 17 00:00:00 2001 From: Simon Clark Date: Tue, 5 May 2026 08:44:31 +0100 Subject: [PATCH 1/2] docs: TestingBase conventions section in patterns/testing.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Captures real-world findings from the netro pilot (first workspace adoption of TestingBase) so future Claude sessions don't repeat them. Five conventions added — each one bit during the pilot: - run_host_script wraps the script as a function body; print() goes to Indigo's event log, not subprocess stdout. Use `return` instead. (Upstream's own utils.py:get_install_folder is the canonical example.) - Plugin state isn't on the HTTP API. Indigo's /v2/api/indigo. exposes only devices/variables/actionGroups/controlPages/logs/ triggers/schedules. Plugin queries (isEnabled, isRunning) go through the IOM via run_host_script + indigo.server.getPlugin(). - /usr/local/indigo/ ships as drwxrwx--- root:wheel on fresh 2025.2 installs. Regular users can't traverse it; sudo chmod 0755 fixes. - New reflectors need an Indigo Server restart before they're live. Until then httpx gets the public indigodomo.com "Not Found" page. - Local IWS is HTTP-only on port 8176. Upstream's ENV_TEMPLATE default of https://localhost:8176 produces SSL handshake timeouts. Also adds a clear pointer to TestingBase upstream as the authoritative source for TestingBase usage (separate from /indigo:dev which is the authoritative source for the Indigo plugin SDK). Conflating the two caused real time-loss in the pilot — explicit guidance prevents that for the next adoption. Bump 1.9.1 -> 1.9.2 (patch, pure docs augmentation). Co-Authored-By: Claude Opus 4.7 (1M context) --- .claude-plugin/marketplace.json | 2 +- .claude-plugin/plugin.json | 2 +- docs/plugin-dev/patterns/testing.md | 68 ++++++++++++++++++++++++++++- 3 files changed, 69 insertions(+), 3 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 692fe0f..ae8f407 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -8,7 +8,7 @@ "name": "indigo", "source": "./", "description": "Indigo home automation development toolkit \u2014 plugin development, API integration, and control page building", - "version": "1.9.3", + "version": "1.9.4", "repository": "https://github.com/simons-plugins/indigo-claude-plugin", "license": "MIT", "keywords": [ diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 5e93bd7..260caca 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "indigo", - "version": "1.9.3", + "version": "1.9.4", "description": "Indigo home automation development toolkit \u2014 plugin development, API integration, and control page building", "repository": "https://github.com/simons-plugins/indigo-claude-plugin" } diff --git a/docs/plugin-dev/patterns/testing.md b/docs/plugin-dev/patterns/testing.md index 7d1825c..8e7d46f 100644 --- a/docs/plugin-dev/patterns/testing.md +++ b/docs/plugin-dev/patterns/testing.md @@ -127,8 +127,74 @@ Use both for any non-trivial plugin: A on every commit, B before each release. --- +## TestingBase conventions worth knowing + +The upstream [TestingBase repo](https://github.com/IndigoDomotics/TestingBase) is the authoritative source for TestingBase usage — its `README.md` and `example_test_xml_files.py` document the public API. `/indigo:dev` covers Indigo plugin SDK questions; for TestingBase-specific questions, read upstream first. + +A few conventions that aren't intuitive and have bitten downstream consumers: + +### `run_host_script` uses `return`, not `print` + +`tests/shared/utils.py:run_host_script(script)` wraps `indigo-host -e