Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle UI Update Issues - Improved Value Change Handling in Samsung AC Integration #169

Merged

Conversation

omerfaruk-aran
Copy link
Owner

Description: This PR introduces enhancements to the Samsung AC integration, specifically addressing the UI update issues related to value changes. The core improvement lies in handling mode changes and ensuring that the interface accurately reflects the current state of the devices.

Key Changes:

  • Value Change Detection: A mechanism has been implemented to detect changes in the device modes. If a change is detected, it triggers an update while also keeping track of pending changes to ensure consistency.

  • Timeout Handling: Introduced a timeout period (750ms) to handle cases where the value might be stale or hasn't updated in time. This helps in forcefully updating the interface if required.

  • Enhanced Debug Logging: Improved logging to provide better insights into the device state and update process. This includes logging when the value changes, when a stale value is detected, and when a timeout forces an update.

  • Data Processing Initialization: Ensured that data processing only begins after the first update, avoiding premature data handling issues.

These changes are designed to provide a more responsive and reliable interface, particularly in environments with multiple devices.

Copy link
Collaborator

@lanwin lanwin left a comment

Choose a reason for hiding this comment

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

Thank you for that pullreuqest. It seems you are a much more experienced c++ developer then me.

components/samsung_ac/protocol.h Outdated Show resolved Hide resolved
components/samsung_ac/samsung_ac.cpp Outdated Show resolved Hide resolved
components/samsung_ac/samsung_ac.cpp Show resolved Hide resolved
- Introduced DeviceStateTracker class to handle state changes and timeout management.
- Refactored samsung_ac.h and samsung_ac.cpp to use DeviceStateTracker instead of manual state tracking.
- Removed old state tracking variables and methods, replaced with DeviceStateTracker integration.
@omerfaruk-aran
Copy link
Owner Author

Thank you for that pullreuqest. It seems you are a much more experienced c++ developer then me.

Thank you! I appreciate your kind words. I'm always open to learning and sharing experiences. Collaborating on code development is always a productive experience.

@htht2001
Copy link

htht2001 commented Oct 7, 2024

@omerfaruk-aran
Thank you for your contribution
@lanwin
Is there a merger expected?

@lanwin
Copy link
Collaborator

lanwin commented Oct 8, 2024

Yes I plan to merge this. But I just hand to many other stuff going, so I hand no time to review the changes again. But hope to do it soon.

@lanwin lanwin merged commit 1917619 into omerfaruk-aran:main Oct 9, 2024
@omerfaruk-aran omerfaruk-aran deleted the feature/handle-value-changes branch October 14, 2024 22:03
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.

Lag when sending commands to AC
3 participants