You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add AstraMeter device connections and improve device naming (#311)
* HA discovery: brand meters as AstraMeter, link consumers via astrameter connection
- CT002 / Shelly meter device names now include "AstraMeter".
- Meter and consumer/battery devices share an `astrameter` connection
tuple so Home Assistant can correlate consumers with their meter.
* Revert changelog edit
* Use via_device instead of astrameter connection to link consumers to meter
* Link meter devices to add-on via_device using supervisor slug
Resolve the add-on slug from the supervisor (`/store/addons/self`) in
run.sh and forward it as `ADDON_SLUG` in the `[MQTT_INSIGHTS]` section.
The MQTT Insights service then sets `via_device: <addon_slug>` on the
CT002 and Shelly meter discovery payloads so Home Assistant nests them
under the AstraMeter add-on device.
* Address review nits on add-on slug handling
- run.sh: query the canonical /addons/self/info endpoint and parse the
slug with jq instead of relying on the /store/addons/self route.
- config_loader: strip ADDON_SLUG before falling back to None so
whitespace-only values do not become a bogus slug.
- tests: assert addon_slug is None for default/empty configs and add a
whitespace-only regression test.
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments