Send only changed Fog device properties via separated HA state.#60
Merged
Conversation
stackia#57. Fog platform property updates now diff desired state against reported device state instead of sending the full command payload. HA coordinator keeps reported_state (from MQTT/poll) and an independent mutable state copy for entity writes, so in-place UI updates no longer invalidate the diff baseline. Add DeyeDeviceState.copy() and DeyeDeviceCommand.to_json_diff(). DeyeFogMqttClient.publish_command() accepts an optional properties dict; HA builds the diff and syncs reported_state after publish.
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #60 +/- ##
==========================================
- Coverage 92.33% 92.20% -0.14%
==========================================
Files 7 7
Lines 809 821 +12
Branches 79 80 +1
==========================================
+ Hits 747 757 +10
- Misses 26 27 +1
- Partials 36 37 +1 ☔ View full report in Codecov by Sentry. |
for more information, see https://pre-commit.ci
This reverts commit e1a6d72.
# Conflicts: # src/libdeye/device_command.py
Owner
|
Published in v2.1.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fog platform property updates now diff desired state against reported device state instead of sending the full command payload. HA coordinator keeps reported_state (from MQTT/poll) and an independent mutable state copy for entity writes, so in-place UI updates no longer invalidate the diff baseline.
Add DeyeDeviceState.copy() and DeyeDeviceCommand.to_json_diff(). DeyeFogMqttClient.publish_command() accepts an optional properties dict; HA builds the diff and syncs reported_state after publish.