Closed tgrusendorf closed 3 years ago
Thanks for the detailed report and detective work.
You almost wrote the PR anyway!
If you can test that would be great - although the code should be pretty safe.
BTW ``` is your friend for formatting - I changed the first code block for you as an example.
Thanks! Tested, comment added describing the 3 test cases, and approved.
Being a hobbyist I only have passing familiarity with the PR process. I tested by pasting the modified code into my local copy of the library. Is there an easy way for me to load the library with the proposed PR on my machine for testing?
I've released it now - so just bump your version if that's easy.
How to install a PR version of a library depends a lot on what's you're running - and how it's installed.
Problem: For devices which have never had a communication failure, the VeraDevice comm_failure method incorrectly returns True when the device is communicating. This is due to the 'CommFailure' variable not being present in the device info returned by Vera.
It appears that my Vera Edge does not include the CommFailure variable in the device info that it returns until there has been a communication failure. At this point, the CommFailure variable starts appearing in responses, with a value of '1'. After communication returns to normal, it continues to include the CommFailure variable in reponses, with a value of '0'.
If the response does not include the CommFailure variable, the comm_failure method incorrectly returns True since the variable is not equal to '1':
I tried modifying the method to check for the existence of the value first, it it performs as expected:
Further detail: Vera Edge controller firmware version: 1.7.5185 (7.31) Device under test: Leviton DZ15S
Example response from a device which has not experienced a communication failure:
Example response from a device which has previously experienced a communication failure and has returned to normal: