Skip to content

Send only changed Fog device properties via separated HA state.#60

Merged
stackia merged 9 commits into
stackia:mainfrom
sususweet:main
May 20, 2026
Merged

Send only changed Fog device properties via separated HA state.#60
stackia merged 9 commits into
stackia:mainfrom
sususweet:main

Conversation

@sususweet
Copy link
Copy Markdown
Contributor

@sususweet sususweet commented May 20, 2026

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.

sususweet and others added 5 commits September 21, 2025 14:23
 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.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.20%. Comparing base (818819b) to head (9567241).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/libdeye/device_command.py 77.77% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Owner

@stackia stackia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm👍

@stackia stackia merged commit 3bc4578 into stackia:main May 20, 2026
2 of 4 checks passed
@stackia
Copy link
Copy Markdown
Owner

stackia commented May 20, 2026

Published in v2.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants