From 84402eedcc8889bff3bfc3c89176cb6b30eb2665 Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Wed, 28 Oct 2026 14:01:03 +0000 Subject: [PATCH 1/8] Release version 0.4.3 --- CHANGELOG.md | 2 +- docs/changelog/0.4.3.md | 1 + pyproject.toml | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 docs/changelog/0.4.3.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 0904e18..79e9d1e 120000 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -docs/changelog/0.3.4.md \ No newline at end of file +docs/changelog/0.4.3.md \ No newline at end of file diff --git a/docs/changelog/0.4.3.md b/docs/changelog/0.4.3.md new file mode 100644 index 0000000..0b09f2b --- /dev/null +++ b/docs/changelog/0.4.3.md @@ -0,0 +1 @@ +- Updated the Corio dependency to the current compatible release. diff --git a/pyproject.toml b/pyproject.toml index 6b7e94f..21656a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=82", "wheel"] build-backend = "setuptools.build_meta" [tool.corio.metadata] -version = "0.4.2" +version = "0.4.3" port = 6 base = "python" description = "Home Assistant Control Objects" @@ -38,19 +38,19 @@ env_list = [] [project] name = "haco" -version = "0.4.2" +version = "0.4.3" description = "Home Assistant Control Objects" readme = "README.md" license = "Apache-2.0" keywords = ["homeassistant", "controls", "python", "tasmota"] -dependencies = ["corio[api,caching,debug,logging,mqtt,sets,version.dev,yaml]~=2.8.2", "psutil"] +dependencies = ["corio[api,caching,debug,logging,mqtt,sets,version.dev,yaml]~=2.15.9", "psutil"] [[project.authors]] name = "Frontmatter AI" email = "innovative.fowler@mask.pro.fmtr.dev" [project.optional-dependencies] -test = ["corio[test]~=2.8.2"] +test = ["corio[test]~=2.15.9"] [project.urls] Homepage = "https://github.com/fmtr/haco" From 8daac7342d33ae04c325e690eec9c0f001a0eb21 Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Wed, 28 Oct 2026 16:10:32 +0000 Subject: [PATCH 2/8] Fix Corio package path logging --- haco/obs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haco/obs.py b/haco/obs.py index b0b1d93..121b056 100644 --- a/haco/obs.py +++ b/haco/obs.py @@ -10,7 +10,7 @@ from haco.paths import paths debug.trace() logger = logs.get_logger( - name=paths.name_ns, + name=paths.name, stream=Constants.DEVELOPMENT, version=paths.metadata.version, ) From 362081a883161672cecc9e44108b7f6a91b33fbf Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Wed, 28 Oct 2026 16:11:35 +0000 Subject: [PATCH 3/8] Add move completion tests --- haco/tests/test_move_complete.py | 155 +++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 haco/tests/test_move_complete.py diff --git a/haco/tests/test_move_complete.py b/haco/tests/test_move_complete.py new file mode 100644 index 0000000..47d2bbe --- /dev/null +++ b/haco/tests/test_move_complete.py @@ -0,0 +1,155 @@ +from __future__ import annotations + +import asyncio +from types import SimpleNamespace +from unittest.mock import AsyncMock + +import pytest + +from corio import Path + +from haco.device import Device +from haco.switch import Switch + + +def run(coro): + return asyncio.run(coro) + + +def message(payload: str) -> SimpleNamespace: + return SimpleNamespace(payload=payload.encode("utf-8")) + + +@pytest.fixture +def client_stub(): + return SimpleNamespace( + topic=Path("root/client"), + will=SimpleNamespace(topic="root/status"), + publish=AsyncMock(), + ) + + +_UNSET = object() + + +def build_switch(client_stub, *, command=_UNSET, state=_UNSET): + switch = Switch(name="Main") + if command is not _UNSET: + switch.command = command + if state is not _UNSET: + switch.state = state + + device = Device(name="Dev", controls=[switch]) + device.set_parent(client_stub) + return switch + + +def test_move_complete_sync_command_updates_state_and_publishes(client_stub): + seen_command = [] + seen_state = [] + + def command(value): + seen_command.append(value) + return value + + def state(value): + seen_state.append(value) + return value + + switch = build_switch(client_stub, command=command, state=state) + command_topic = switch.capabilities[0].command + + run(command_topic.handle(message("ON"))) + + assert seen_command == [True] + assert seen_state == [True] + client_stub.publish.assert_awaited_once_with( + "root/client/dev/main/default/state", + "ON", + retain=True, + ) + + +def test_move_complete_async_command_updates_state_and_publishes(client_stub): + seen_command = [] + seen_state = [] + + async def command(value): + seen_command.append(value) + return not value + + async def state(value): + seen_state.append(value) + return value + + switch = build_switch(client_stub, command=command, state=state) + command_topic = switch.capabilities[0].command + + run(command_topic.handle(message("OFF"))) + + assert seen_command == [False] + assert seen_state == [True] + client_stub.publish.assert_awaited_once_with( + "root/client/dev/main/default/state", + "ON", + retain=True, + ) + + +def test_move_complete_state_handler_sync_publish_path(client_stub): + seen_state = [] + + def state(value): + seen_state.append(value) + return value + + switch = build_switch(client_stub, state=state) + state_topic = switch.capabilities[0].state + + value_raw = run(state_topic.handle(False)) + + assert seen_state == [False] + assert value_raw == "OFF" + client_stub.publish.assert_awaited_once_with( + "root/client/dev/main/default/state", + "OFF", + retain=True, + ) + + +def test_move_complete_command_missing_handler_stops_before_state(client_stub): + seen_state = [] + switch = build_switch( + client_stub, + command=None, + state=lambda value: seen_state.append(value) or value, + ) + command_topic = switch.capabilities[0].command + + result = run(command_topic.handle(message("ON"))) + + assert result is None + assert seen_state == [] + client_stub.publish.assert_not_awaited() + + +def test_move_complete_state_missing_handler_stops(client_stub): + switch = build_switch(client_stub, state=None) + state_topic = switch.capabilities[0].state + + result = run(state_topic.handle(True)) + + assert result is None + client_stub.publish.assert_not_awaited() + + +def test_move_complete_not_implemented_command_stops_before_state(client_stub): + seen_state = [] + switch = build_switch(client_stub, state=lambda value: seen_state.append(value) or value) + command_topic = switch.capabilities[0].command + + result = run(command_topic.handle(message("ON"))) + + assert result is None + assert seen_state == [] + client_stub.publish.assert_not_awaited() From d13fd9a236ab33d8f2a9a002b0410311ae897e5a Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Wed, 28 Oct 2026 16:12:44 +0000 Subject: [PATCH 4/8] Release version 0.4.4 --- CHANGELOG.md | 2 +- docs/changelog/0.4.4.md | 2 ++ pyproject.toml | 12 ++++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 docs/changelog/0.4.4.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 79e9d1e..1bd4739 120000 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -docs/changelog/0.4.3.md \ No newline at end of file +docs/changelog/0.4.4.md \ No newline at end of file diff --git a/docs/changelog/0.4.4.md b/docs/changelog/0.4.4.md new file mode 100644 index 0000000..be96460 --- /dev/null +++ b/docs/changelog/0.4.4.md @@ -0,0 +1,2 @@ +- Updated Corio integration for the current package paths API. +- Added an automated test environment for the package test suite. diff --git a/pyproject.toml b/pyproject.toml index 21656a9..d8127a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=82", "wheel"] build-backend = "setuptools.build_meta" [tool.corio.metadata] -version = "0.4.3" +version = "0.4.4" port = 6 base = "python" description = "Home Assistant Control Objects" @@ -18,6 +18,9 @@ is_dockerhub = false [tool.corio.metadata.setup] +[tool.corio.dependencies] +test = ["corio[test]"] + [tool.setuptools.packages.find] where = ["."] include = ["haco*"] @@ -38,19 +41,20 @@ env_list = [] [project] name = "haco" -version = "0.4.3" +version = "0.4.4" description = "Home Assistant Control Objects" readme = "README.md" license = "Apache-2.0" keywords = ["homeassistant", "controls", "python", "tasmota"] -dependencies = ["corio[api,caching,debug,logging,mqtt,sets,version.dev,yaml]~=2.15.9", "psutil"] +dependencies = [] [[project.authors]] name = "Frontmatter AI" email = "innovative.fowler@mask.pro.fmtr.dev" [project.optional-dependencies] -test = ["corio[test]~=2.15.9"] +test = ["corio[test]~=2.15.10"] +all = ["corio[test]~=2.15.10"] [project.urls] Homepage = "https://github.com/fmtr/haco" From a8359d46b1021035c81c77dd078554225cb878b0 Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Wed, 28 Oct 2026 17:40:59 +0000 Subject: [PATCH 5/8] Release version 0.4.5 --- CHANGELOG.md | 2 +- docs/changelog/0.4.5.md | 2 ++ pyproject.toml | 10 +++------- 3 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 docs/changelog/0.4.5.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bd4739..6fa8d06 120000 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -docs/changelog/0.4.4.md \ No newline at end of file +docs/changelog/0.4.5.md \ No newline at end of file diff --git a/docs/changelog/0.4.5.md b/docs/changelog/0.4.5.md new file mode 100644 index 0000000..cbe3fb3 --- /dev/null +++ b/docs/changelog/0.4.5.md @@ -0,0 +1,2 @@ +- Restored the runtime dependency metadata for installations. +- Added the automated Haco test environment to release validation. diff --git a/pyproject.toml b/pyproject.toml index d8127a0..1ab8771 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=82", "wheel"] build-backend = "setuptools.build_meta" [tool.corio.metadata] -version = "0.4.4" +version = "0.4.5" port = 6 base = "python" description = "Home Assistant Control Objects" @@ -18,9 +18,6 @@ is_dockerhub = false [tool.corio.metadata.setup] -[tool.corio.dependencies] -test = ["corio[test]"] - [tool.setuptools.packages.find] where = ["."] include = ["haco*"] @@ -41,12 +38,12 @@ env_list = [] [project] name = "haco" -version = "0.4.4" +version = "0.4.5" description = "Home Assistant Control Objects" readme = "README.md" license = "Apache-2.0" keywords = ["homeassistant", "controls", "python", "tasmota"] -dependencies = [] +dependencies = ["corio[api,caching,debug,logging,mqtt,sets,version.dev,yaml]~=2.15.10", "psutil"] [[project.authors]] name = "Frontmatter AI" @@ -54,7 +51,6 @@ email = "innovative.fowler@mask.pro.fmtr.dev" [project.optional-dependencies] test = ["corio[test]~=2.15.10"] -all = ["corio[test]~=2.15.10"] [project.urls] Homepage = "https://github.com/fmtr/haco" From 06e5d43bca5dfe87c870d0673c539e0204836f61 Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Wed, 28 Oct 2026 18:19:03 +0000 Subject: [PATCH 6/8] Configure Haco development environment --- pyproject.toml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1ab8771..ef91fb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,9 +32,12 @@ editable = true [tool.tox] requires = ["tox>=4.22", "tox-uv>=1"] -env_list = [] +env_list = ["haco"] -[tool.tox.env] +[tool.tox.env.haco] +description = "Run haco tests." +deps = ["corio[test]~=2.15.10"] +commands = [["python", "-m", "pytest", "-q", "{posargs:haco/tests}"]] [project] name = "haco" @@ -50,9 +53,13 @@ name = "Frontmatter AI" email = "innovative.fowler@mask.pro.fmtr.dev" [project.optional-dependencies] +dev = ["corio[infra]~=2.15.10"] test = ["corio[test]~=2.15.10"] [project.urls] Homepage = "https://github.com/fmtr/haco" [project.scripts] + +[dependency-groups] +dev = ["corio[infra]~=2.15.10"] From 9dd13b4890c959372d0bdc6714307ed50b148f8f Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Fri, 13 Nov 2026 13:14:12 +0000 Subject: [PATCH 7/8] Release version 0.4.6-alpha.0 --- pyproject.toml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ef91fb6..507fafc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=82", "wheel"] build-backend = "setuptools.build_meta" [tool.corio.metadata] -version = "0.4.5" +version = "0.4.6-alpha.0" port = 6 base = "python" description = "Home Assistant Control Objects" @@ -15,6 +15,7 @@ services = [] keywords = ["homeassistant", "controls", "python", "tasmota"] is_pypi = true is_dockerhub = false +editables = ["corio"] [tool.corio.metadata.setup] @@ -30,31 +31,35 @@ haco = ["pyproject.package.toml", "assets/**"] path = "../corio" editable = true +[tool.uv.config-settings-package.corio] +editable_mode = "compat" + [tool.tox] requires = ["tox>=4.22", "tox-uv>=1"] env_list = ["haco"] [tool.tox.env.haco] description = "Run haco tests." -deps = ["corio[test]~=2.15.10"] +deps = ["corio[test]~=2.17.8"] commands = [["python", "-m", "pytest", "-q", "{posargs:haco/tests}"]] +install_command = ["uv", "pip", "install", "--refresh-package", "corio", "{opts}", "{packages}"] [project] name = "haco" -version = "0.4.5" +version = "0.4.6-alpha.0" description = "Home Assistant Control Objects" readme = "README.md" license = "Apache-2.0" keywords = ["homeassistant", "controls", "python", "tasmota"] -dependencies = ["corio[api,caching,debug,logging,mqtt,sets,version.dev,yaml]~=2.15.10", "psutil"] +dependencies = ["corio[api,caching,debug,logging,mqtt,sets,yaml]~=2.17.8", "psutil"] [[project.authors]] name = "Frontmatter AI" email = "innovative.fowler@mask.pro.fmtr.dev" [project.optional-dependencies] -dev = ["corio[infra]~=2.15.10"] -test = ["corio[test]~=2.15.10"] +dev = ["corio[infra]~=2.17.8"] +test = ["corio[test]~=2.17.8"] [project.urls] Homepage = "https://github.com/fmtr/haco" @@ -62,4 +67,4 @@ Homepage = "https://github.com/fmtr/haco" [project.scripts] [dependency-groups] -dev = ["corio[infra]~=2.15.10"] +dev = ["corio[infra]~=2.17.8"] From a8c7f4ae6af3b6e8ba1eb0445f97c24b0dfd3048 Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Fri, 13 Nov 2026 14:02:21 +0000 Subject: [PATCH 8/8] Release version 0.4.6 --- CHANGELOG.md | 2 +- docs/changelog/0.4.6.md | 1 + pyproject.toml | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 docs/changelog/0.4.6.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fa8d06..f23c2e4 120000 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -docs/changelog/0.4.5.md \ No newline at end of file +docs/changelog/0.4.6.md \ No newline at end of file diff --git a/docs/changelog/0.4.6.md b/docs/changelog/0.4.6.md new file mode 100644 index 0000000..1885d7a --- /dev/null +++ b/docs/changelog/0.4.6.md @@ -0,0 +1 @@ +- Update the Corio dependency to its latest stable release. diff --git a/pyproject.toml b/pyproject.toml index 507fafc..450ff74 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=82", "wheel"] build-backend = "setuptools.build_meta" [tool.corio.metadata] -version = "0.4.6-alpha.0" +version = "0.4.6" port = 6 base = "python" description = "Home Assistant Control Objects" @@ -46,7 +46,7 @@ install_command = ["uv", "pip", "install", "--refresh-package", "corio", "{opts} [project] name = "haco" -version = "0.4.6-alpha.0" +version = "0.4.6" description = "Home Assistant Control Objects" readme = "README.md" license = "Apache-2.0"