feat: Coordinator, Geraet und Licht-Entitaet

This commit is contained in:
Michael Sauer
2026-09-16 15:32:07 +02:00
parent 75dc2b7dd6
commit 40186d95d1
13 changed files with 1137 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
"""Helpers for Home Assistant tests."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from custom_components.ninlight.const import DOMAIN
from tests_unit.samples import MAC_RGB
def entity_id_for(hass: HomeAssistant, platform: str, key: str, mac: str = MAC_RGB) -> str:
"""Look entities up by unique_id instead of guessing slugs."""
entity_id = er.async_get(hass).async_get_entity_id(platform, DOMAIN, f"{mac}_{key}")
assert entity_id is not None, f"no {platform} entity with key {key}"
return entity_id