Per-entity availability, deferred discovery publish, suggested precision

- Add HAAvailabilityConfig for per-entity availability_topic and payloads
- Defer discovery until MQTT connected; publish availability after discovery
- HASensor/HANumber: optional suggested_display_precision in discovery
- HASerializer/HADictionary: extend for new keys; update device types and mocks
- Docs and examples reflect availability and precision usage
- Tests updated for discovery and availability behavior
- Ignore .cursor/ in repo root
This commit is contained in:
2026-05-05 17:47:55 +10:00
parent 8ba5482892
commit b9f4fd7f4b
62 changed files with 2705 additions and 283 deletions
+7
View File
@@ -24,6 +24,7 @@ lib_deps =
* Two-way communication (state reporting and command execution)
* MQTT discovery (device is added to the Home Assistant panel automatically)
* Rich discovery metadata for entities, devices, origin, templates and availability
* MQTT Last Will and Testament
* Support for custom MQTT messages (publishing and subscribing)
* Auto reconnect with MQTT broker
@@ -48,6 +49,12 @@ If you need to manage discovery at runtime:
When device discovery mode is enabled, runtime discovery refreshes automatically clear any stale retained per-entity config before republishing the device discovery payload.
Recent discovery additions include:
* Shared entity metadata such as `enabled_by_default`, `entity_picture`, `qos`, `encoding`
* Device/origin metadata such as `model_id`, `hw_version`, `serial_number`, `suggested_area`, `via_device`, `connections`, `support_url`
* Availability payload overrides and multi-topic availability discovery metadata
## Supported HA types
| Home Assistant type | Supported |