Python Framework - Not detecting connection issue
Posted: Monday 10 December 2018 17:16
I'm developing a plugin with the Python Framework and I'm having issue with connection failure.
I was under the impression that the plugin is capable to get information of connection issue, but it looks not !
Here are the 2 connection types I'm creating. The first one is using Serial (USB), the second is using TCP.
In both case, if I start the plugin, the connection is well established.
Then I unplug the USB stick or I powerOff the Wifi device on which there is the connection
And the when checking, it always report True !!!!! Despite the fact that I'm writting to the connection view the Send() method.
Of course when plugin back the USB Stick or PowerOn the Wifi device, nothing restart !
I was under the impression that the plugin is capable to get information of connection issue, but it looks not !
Here are the 2 connection types I'm creating. The first one is using Serial (USB), the second is using TCP.
In both case, if I start the plugin, the connection is well established.
Then I unplug the USB stick or I powerOff the Wifi device on which there is the connection
And the when checking
Code: Select all
self._connection.Connected()Of course when plugin back the USB Stick or PowerOn the Wifi device, nothing restart !
Code: Select all
self._connection = Domoticz.Connection(Name="ZiGate", Transport="Serial", Protocol="None",
Address=self._serialPort, Baud=115200)
self._connection = Domoticz.Connection(Name="Zigate", Transport="TCP/IP", Protocol="None ",
Address=self._wifiAddress, Port=self._wifiPort)