{"id":50755601,"url":"https://github.com/sukramj/openccu-loom-types","last_synced_at":"2026-06-28T13:00:44.937Z","repository":{"id":360052283,"uuid":"1248428593","full_name":"SukramJ/openccu-loom-types","owner":"SukramJ","description":"Generated Pydantic v2 models and enum types for the openccu-loom REST + WebSocket contract","archived":false,"fork":false,"pushed_at":"2026-06-27T09:44:25.000Z","size":175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-27T11:20:31.105Z","etag":null,"topics":["code-generation","home-assistant","homematic","homematicip","openapi","pydantic","python","rest-api","type-hints","websocket"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SukramJ.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-24T16:21:34.000Z","updated_at":"2026-06-27T09:44:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/SukramJ/openccu-loom-types","commit_stats":null,"previous_names":["sukramj/openccu-loom-types-py"],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/SukramJ/openccu-loom-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukramJ%2Fopenccu-loom-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukramJ%2Fopenccu-loom-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukramJ%2Fopenccu-loom-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukramJ%2Fopenccu-loom-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SukramJ","download_url":"https://codeload.github.com/SukramJ/openccu-loom-types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukramJ%2Fopenccu-loom-types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34889047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","home-assistant","homematic","homematicip","openapi","pydantic","python","rest-api","type-hints","websocket"],"created_at":"2026-06-11T05:00:14.076Z","updated_at":"2026-06-28T13:00:44.931Z","avatar_url":"https://github.com/SukramJ.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openccu-loom-types\n\nGenerated Pydantic models + enum definitions for the openccu-loom\nREST + WebSocket contract. Sister-repo to the\n[openccu-loom daemon](https://github.com/SukramJ/openccu-loom);\npublishable as `openccu-loom-types` on PyPI.\n\n## What this package provides\n\n- `openccu_loom_types.enums` — every enum from the daemon's\n  `pkg/hmenum`. Each enum is a `str`-typed Python `Enum` whose values\n  match the wire strings the CCU emits. Source of truth:\n  `assets/schemas/enums.json` in the openccu-loom repo.\n- `openccu_loom_types.rest` — Pydantic models for the REST surface.\n  Generated from `assets/openapi.yaml` via `datamodel-code-generator`.\n- `openccu_loom_types.ws` — Pydantic models for the WebSocket\n  envelope + push payloads. Generated from the same OpenAPI document\n  (the WS envelope schemas live in `components.schemas` per ADR-0020).\n\n## Why this exists (asks.md C1 + C3)\n\nHigher-level clients (`openccu-loom-client`, the future\nhomematicip_local refactor) need stable typed bindings against the\ndaemon. Without a published types package each consumer would\nduplicate the model code and drift away from the daemon's wire\ncontract. This package is the single import every Python consumer\nshares — version-pinned and CI-rebuilt on every openccu-loom release.\n\n## Regeneration workflow\n\nSet `OPENCCU_LOOM_REPO` to a local checkout of the daemon repo\n(default: `../openccu-loom`):\n\n```sh\n# Step 1 — make sure the daemon repo's schema export is fresh:\nmake -C \"$OPENCCU_LOOM_REPO\" export-schemas\n\n# Step 2 — regenerate this package's models:\nmake generate\n```\n\nThe two-step split keeps the daemon repo authoritative; this package\nnever re-parses Go source.\n\n### Tooling required\n\n- Python \u003e= 3.11\n- `datamodel-code-generator` \u003e= 0.25 (for REST + WS Pydantic models)\n\nInstall both with `pip install -e '.[dev]'`.\n\n## Versioning \u0026 contract identity\n\nThe package version (`const.VERSION`) is independent of the daemon\nversion; the regeneration workflow bumps the patch number on every\ndaemon release. The daemon coupling is carried by two stamped\nconstants in `const.py` (written by `make generate` →\n`scripts/stamp_const.py`):\n\n- `SCHEMA_DIGEST` — canonical digest of the daemon's contract assets\n  these types were generated from (definition: daemon ADR-0028).\n  Clients compare it against `GET /api/v1/info`.`schema_digest` to\n  verify exact type/daemon parity at connect time.\n- `DAEMON_API_VERSION` — the daemon's `api_version` at generation\n  time. Minor bumps add fields without breaking existing consumers;\n  major bumps remove or rename payload fields, scopes, or\n  capabilities — see ADR-0020 in the daemon repo.\n\nRegeneration and release are automated end to end. The daemon's\nrelease workflow fires a `repository_dispatch` (`daemon-release`) at\nthis repo, which drives this chain:\n\n1. `regenerate-on-daemon-release` checks out the daemon at the released\n   tag, regenerates all modules, stamps the constants, bumps the\n   version, seeds a baseline changelog section, opens a PR from a\n   `regen/daemon-\u003ctag\u003e` branch, and enables auto-merge.\n2. `ci` runs on the PR: `Test` (the suite) and `Regen clean` (re-runs\n   `make generate` against the branch's daemon tag and fails on any\n   drift, so hand-edits to generated modules are caught).\n3. Once the required checks are green the PR squash-merges;\n   `tag-on-regen-merge` then pushes `v\u003cversion\u003e`.\n4. The tag triggers `release-on-tag` → GitHub Release →\n   `python-publish` → PyPI.\n\nManual fallback: `workflow_dispatch` with the tag, or the local\ntwo-step flow above.\n\n### CI / release setup\n\nThe automation needs three one-time repository settings; without them\nthe chain stops after step 1:\n\n- A **`RELEASE_PAT`** secret — a fine-grained PAT (or GitHub App token)\n  with `contents: write` + `pull-requests: write`. The regen PR and the\n  release tag are pushed with it, because a branch/PR/tag created via\n  the default `GITHUB_TOKEN` does **not** trigger the downstream CI and\n  release workflows (GitHub's recursive-workflow guard).\n- **Branch protection** on `main` requiring the `Test` and\n  `Regen clean` status checks — auto-merge waits on these.\n- **Allow auto-merge** enabled in the repository settings.\n\n## What this package does NOT contain\n\n- HTTP / WebSocket transport — see `openccu-loom-client`\n  (when published) for the higher-level client.\n- Any business logic — types only.\n- Async helpers — types are framework-neutral.\n\n## License\n\nMIT. See [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukramj%2Fopenccu-loom-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukramj%2Fopenccu-loom-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukramj%2Fopenccu-loom-types/lists"}