solax
solax copied to clipboard
raise validation error for all zero response data
This is a possible solution for https://github.com/squishykid/solax/issues/67.
After this PR:
- the response dict will be validate using a schema definition, therefore the access to the dict properties are more safe now
- the check includes a validation that at least one value in 'Data' is not 0
Consequences for Home assistant: If an zeros data event occurs, the validation error will cause the sensor update to fail and thereby the inherent home assistant retry will be triggered. No Changes to the solax integration are required.