mirror of
https://github.com/fmtr/haco.git
synced 2026-10-26 19:01:51 -04:00
1.1 KiB
1.1 KiB
- Refactored core models from
dataclassto Pydantic across active entities (Base,Device,Control,Capability, topic models, and concrete control types likeSwitch,Climate,Sensor, etc.). - Replaced dataclass-specific field metadata (
metadata=dict(exclude=True),field(...),__post_init__) with native Pydantic patterns (Field(...),model_post_init, class inheritance fromcorio.dm.Base). - Updated parent/back-reference handling to follow the parent-typing pattern, including explicit in-
__init__imports for forward references (e.g.Device.parent: ClientHaco | None). - Reworked
Base.model_dump()to preserve discovery behavior by merging classDATA, defaulting toexclude_none=True, and excluding runtime extra attributes so dynamic callbacks do not leak into HA announce payloads. - Cleaned up dataclass leftovers by removing the unused
Metadatahelper fromhaco/utils.pyand simplifying related imports. - Added packaging metadata and testing support updates:
pyproject.tomlproject metadata/uv source config,setup.pytest extras (pytest,pytest-cov), and initialhaco/testspackage scaffolding.