| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Created helper functions to eliminate code duplication in MQTT operations:
- device_mqtt_subscribe: handles subscription with timeout and error logging
- device_mqtt_publish: handles publishing with optional retain flag
- mqtt_receive_data: handles data receiving with buffer validation and timeout
- publish_entity_discoveries: publishes all entity discoveries
- generate_entity_discovery: generates entity discovery payloads
Refactored buffer management by introducing DeviceBuffersOwned and
DeviceBuffers structures to group related buffers together, making them
easier to pass to helper functions.
Added MQTT_TIMEOUT constant at module level for consistent timeout handling.
Fixed bug where only the last entity's discovery was republished when Home
Assistant came back online. Now correctly republishes all entities by
subscribing to homeassistant/status and using publish_entity_discoveries
when the "online" status is received.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
|