Devices data being set with invalid values on update, causing errors with setting switches and lights #115
Closed
anderjoshai wants to merge 5 commits intoflz:masterfrom
Closed
Devices data being set with invalid values on update, causing errors with setting switches and lights #115anderjoshai wants to merge 5 commits intoflz:masterfrom
anderjoshai wants to merge 5 commits intoflz:masterfrom
Conversation
Ensure 'state' value is valid aqualink state before updating device data.
Updated validation logic to allow empty updates for 'spa_temp' and 'pool_temp'. Removed redundant state validation checks.
Removed the validate_update_data method from the system class.
Owner
|
@anderjoshai Apologies for the radio silence. Is this not relevant anymore? |
Author
Hi @flz, no worries, happy to hear from you! This issue is indeed still relevant. I created an updated PR for it here #116 |
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.
This applies to the iaqua system, a similar fix may be needed for other systems
This resolves the open HA error described here: home-assistant/core#156960
The library will sometimes fail to set the value of lights and switches with the error "'NaN' is not a valid Aqualink state"
This is a result of the Jandy api returning garbage values for about 30 seconds after a light related command is received. Until the garbage values are overwritten by a valid update, all the devices will have invalid states and properties, leading to various errors.
Here is what the update from the API looks like after turning a light on or off:
The fix validates the update data in system.py before assigning it to a device's data field. This way it will never leave a device in an invalid state, instead it will preserve the last known valid state of the device until a valid update is received.
Confidence Testing:
I ran this change on my local HA system and none of the lights and switches commands failed, and I did not encounter any errors.