This document provides guidance for AI coding agents working on this Home Assistant custom integration project.
This is a Home Assistant custom component for the Israeli Meteorological Service (IMS) Envista API. It provides weather and sensor entities for station observations.
Integration details:
- Domain:
ims_envista - Title:
IMS Envista - Repository:
GuyKh/ims-envista-custom-component
Key directories:
custom_components/ims_envista/- Main integration codeconfig/- Home Assistant config for local developmentscripts/- Local development and validation scripts
- Python: 3.12+
- Home Assistant: custom integration architecture (ConfigEntry + DataUpdateCoordinator)
- API library:
ims-envista(seemanifest.json) - Linting/formatting: Ruff
custom_components/ims_envista/ includes:
__init__.py- integration setup/unload, service registrationconst.py- constants and channel namesconfig_flow.py- user setup flowcoordinator.py- API polling and station data coordinationentity.py- base coordinator entitysensor.py- station condition sensorsweather.py- weather entityservices.yaml- service definitionstranslations/*.json- localization strings
Always use project scripts:
Setup dependencies:
./scripts/setupRun Home Assistant:
./scripts/developLint and format:
./scripts/lint- Prefer surgical changes; avoid unrelated refactors.
- Follow existing Home Assistant patterns:
- Config flow owns user setup and validation.
- Entities read from coordinator data; no direct API calls from entities.
- Use
ConfigEntryAuthFailedfor auth failures andUpdateFailedfor transient update failures.
- Keep translations in sync when adding/changing config flow errors, abort reasons, entities, or services.
- Preserve backward compatibility for entity IDs/unique IDs unless explicitly requested.
- If a change can break existing user automations/dashboards, call it out clearly before proceeding.
Before finishing work, run:
./scripts/lintIf linting fails, fix issues and rerun until it passes.