-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Handle UI Update Issues - Improved Value Change Handling in Samsung AC Integration #169
Conversation
…ludes and redundant code
…used includes and redundant code
There was a problem hiding this 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.
- 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.
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. |
@omerfaruk-aran |
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. |
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.