{"id":50429307,"url":"https://github.com/roquerodrigo/ha-integration-blueprint","last_synced_at":"2026-05-31T13:01:36.403Z","repository":{"id":356620337,"uuid":"1230967850","full_name":"roquerodrigo/ha-integration-blueprint","owner":"roquerodrigo","description":"Template for Home Assistant custom integrations distributed via HACS — DataUpdateCoordinator, config/reauth/reconfigure/options flows, diagnostics, repairs, strict typing, 95% coverage gate","archived":false,"fork":false,"pushed_at":"2026-05-19T19:56:03.000Z","size":110,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T23:28:29.877Z","etag":null,"topics":["blueprint","hacs","home-assistant","home-assistant-custom","home-assistant-integration","template"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"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/roquerodrigo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-06T13:50:12.000Z","updated_at":"2026-05-19T19:55:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/roquerodrigo/ha-integration-blueprint","commit_stats":null,"previous_names":["roquerodrigo/ha-integration-blueprint"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/roquerodrigo/ha-integration-blueprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roquerodrigo%2Fha-integration-blueprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roquerodrigo%2Fha-integration-blueprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roquerodrigo%2Fha-integration-blueprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roquerodrigo%2Fha-integration-blueprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roquerodrigo","download_url":"https://codeload.github.com/roquerodrigo/ha-integration-blueprint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roquerodrigo%2Fha-integration-blueprint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33731998,"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-05-31T02:00:06.040Z","response_time":95,"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":["blueprint","hacs","home-assistant","home-assistant-custom","home-assistant-integration","template"],"created_at":"2026-05-31T13:01:35.593Z","updated_at":"2026-05-31T13:01:36.384Z","avatar_url":"https://github.com/roquerodrigo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Home Assistant Integration Blueprint\n\n[![CI](https://github.com/roquerodrigo/ha-integration-blueprint/actions/workflows/ci.yml/badge.svg)](https://github.com/roquerodrigo/ha-integration-blueprint/actions/workflows/ci.yml)\n[![hacs_badge](https://img.shields.io/badge/HACS-Custom-orange.svg)](https://github.com/hacs/integration)\n\nTemplate for creating custom [Home Assistant](https://www.home-assistant.io/) integrations distributable via [HACS](https://hacs.xyz/).\n\nBased on [ludeeus/integration_blueprint](https://github.com/ludeeus/integration_blueprint), with adaptations used in the [@roquerodrigo](https://github.com/roquerodrigo) integrations. Conventions for contributors live in [`CODE_STYLE.md`](./CODE_STYLE.md); architectural notes for AI agents in [`CLAUDE.md`](./CLAUDE.md).\n\n## Add to Home Assistant\n\n[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=roquerodrigo\u0026repository=ha-integration-blueprint\u0026category=integration)\n\n## What's included\n\n- **Full integration scaffold** with `DataUpdateCoordinator`, config flow, options flow, sample sensor and typed `runtime_data`.\n- **Reauth + reconfigure flows** triggered automatically by `ConfigEntryAuthFailed` or by the user.\n- **Options flow** with a configurable `scan_interval` plumbed through to the coordinator.\n- **Diagnostics platform** with credential redaction (`diagnostics.py`).\n- **Repairs platform** (`repairs.py`) wired into HA's Issue Registry, with sample issue + `ConfirmRepairFlow`.\n- **CI**: ruff lint + format, mypy type-check, `hassfest`, HACS validation, CodeQL security scan.\n- **Pre-commit hooks** (`.pre-commit-config.yaml`) — ruff + JSON/YAML/TOML checks.\n- **Coverage gate** at 95 % enforced by `pytest.ini` (currently at 100 %).\n- **Devcontainer** (Debian + Python 3.14) and VS Code extension recommendations.\n- **Scripts** that auto-detect `./.venv` (no `source activate` needed) to start HA in debug or run lint.\n- **Tests** with `pytest-homeassistant-custom-component` covering init, config + reauth + reconfigure flows, options flow, coordinator, API client, base entity, sensor, diagnostics, repairs and translation parity.\n- **Issue templates**, **PR template**, **`.editorconfig`** and grouped Dependabot updates.\n- **Translations** for English and Brazilian Portuguese (with parity test).\n\n## How to use\n\n1. Use this repository as a **template** on GitHub (\"Use this template\" button) or clone it manually.\n2. Rename the domain throughout the codebase:\n   - `custom_components/integration_blueprint/` → `custom_components/\u003cyour_domain\u003e/`\n   - `DOMAIN = \"integration_blueprint\"` in `const.py`; `domain` in `manifest.json`; `name` in `hacs.json`\n   - `name`, `documentation`, `issue_tracker`, `codeowners` in `manifest.json`\n   - Rename classes: `IntegrationBlueprint*` → `\u003cYourDomain\u003e*`\n   - Run `grep -rn integration_blueprint .` to catch leftover imports (especially in `tests/`)\n3. Replace the sample API in `api.py` with your real client and adjust `coordinator.py`, `config_flow.py`, `sensor.py` to match.\n4. Update `translations/en.json` and `translations/pt-BR.json` (parity is enforced by tests).\n5. Replace the placeholder brand assets in `custom_components/integration_blueprint/brand/` (`icon.png`, `icon@2x.png`, `logo.png`, `logo@2x.png`) with your own — these satisfy the HACS brand check locally until you register the integration in [`home-assistant/brands`](https://github.com/home-assistant/brands).\n6. Update `README.md` and `CLAUDE.md` for your integration.\n\n## Useful commands\n\n```bash\nscripts/setup      # install dependencies (requirements.txt)\nscripts/develop    # start Home Assistant in debug mode with the integration loaded\nscripts/lint       # ruff format + check + mypy\npytest             # run tests with the 95 % coverage gate\n```\n\nEach script auto-detects `./.venv` and prepends it to `PATH` — no `source .venv/bin/activate` needed. For ad-hoc commands the same trick works: `.venv/bin/pytest`, `.venv/bin/ruff …`.\n\nHA runs with config in `config/` and `PYTHONPATH` pointing at `custom_components/` — no symlinks. To recreate entity/device IDs during development:\n\n```bash\nrm config/.storage/core.entity_registry config/.storage/core.device_registry\n```\n\n## Layout\n\n```\ncustom_components/integration_blueprint/\n├── __init__.py        # async_setup_entry / unload / reload\n├── api.py             # ApiClient (single class)\n├── config_flow.py     # user / reauth / reconfigure steps\n├── const.py           # DOMAIN, LOGGER, URLs, ATTRIBUTION, scan-interval defaults\n├── coordinator.py     # DataUpdateCoordinator (interval injected from options)\n├── data.py            # typed ConfigEntry + IntegrationBlueprintData dataclass + TypedDicts\n├── diagnostics.py     # downloadable diagnostics with credential redaction\n├── entity.py          # base CoordinatorEntity\n├── exceptions/        # one file per exception class\n│   ├── __init__.py\n│   ├── api_client_authentication_error.py\n│   ├── api_client_communication_error.py\n│   └── api_client_error.py\n├── manifest.json\n├── options_flow.py    # OptionsFlow with scan_interval\n├── repairs.py         # Repair platform: async_create_fix_flow + sample issue\n├── sensor.py          # sample platform\n└── translations/\n    ├── en.json\n    └── pt-BR.json\n```\n\nLayout convention (one top-level class per file; related classes grouped under a directory) is documented in [`CODE_STYLE.md`](./CODE_STYLE.md).\n\n## Pre-commit hooks\n\nInstall once per clone (after `scripts/setup`):\n\n```bash\npre-commit install\n```\n\nThis wires ruff + basic file hygiene checks (`.pre-commit-config.yaml`) into every commit, mirroring the CI lint job.\n\n## CI\n\n- **`lint.yml`** — ruff (check + format) and mypy (Python 3.14)\n- **`validate.yml`** — `hassfest` + HACS validation; push/PR to `main` and a daily cron\n- **`codeql.yml`** — GitHub CodeQL security scan; push/PR to `main` and a weekly cron\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froquerodrigo%2Fha-integration-blueprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froquerodrigo%2Fha-integration-blueprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froquerodrigo%2Fha-integration-blueprint/lists"}