ycahome wrote: Thursday 01 February 2018 9:55
manjh wrote: Thursday 01 February 2018 9:30
this could be a small bug: I tried a corrupted IP-checker address. The plugin crashes:
Code: Select all
2018-02-01 09:27:03.950 Error: (WAN IP checker) 'onHeartbeat' failed 'ValueError'.
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 151 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 109 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 153 in /usr/lib/python3.4/urllib/request.py, function urlopen
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 440 in /usr/lib/python3.4/urllib/request.py, function open
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 258 in /usr/lib/python3.4/urllib/request.py, function __init__
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 284 in /usr/lib/python3.4/urllib/request.py, function full_url
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 313 in /usr/lib/python3.4/urllib/request.py, function _parse
This is because plugin does not contain error handling on urlopen (try catch). Maybe on next version.
If a connection fails completely you will not have a way to post your notification so, another method should be in place (SMS or GPRS).
As for the test, we can include a plugin option "Test" (just like "Debug") with a custom function that will fill a random IP and trick the plugin. Maybe on the next version too.
EDIT: Just remembered that Settings/Notifications have "Test" buttons. You can always try those buttons. You want a different approach?
Thank you
Hmmm... it failed, and it does not get back on its feet any more. I restored the correct value but the plugin still crashes...
For now I have disabled it and will do some more testing later.
As for the test functions: I agree but the test on settings/notifications actually test only that functionality. By adding a test button to the plugin, you could actually test the whole path, including the plugin.
One way to do it is to make the last known IP available to the HW screen. The user could change that, and see the plugin react.