Page 1 of 1

Python onConnect proble with windows

Posted: Tuesday 23 January 2018 21:01
by jluc2808
hello

i have installed domoticz V3.8833 on my windows10 and python 3.7.04a (tried with 3.6.4 and 3.5.4)
when i start some device (material) i get an
Error: (Yamaha ampli) 'onConnect' failed 'TypeError':'onConnect() missing 3 required positional arguments: 'Connection', 'Status', and 'Description''.

my pyhton script:
def onConnect(Connection, Status, Description):
global _plugin
_plugin.onConnect(Connection, Status, Description)

def onConnect(self, Connection, Status, Description):
Domoticz.Debug("onConnect called. Status: " + str(Status))
if (Status == 0):
self.isConnected = True
self.onHeartbeat()
else:
self.isConnected = False


when i use the same code with my NAS and python3.5.4 i haven't this error

could someone give me a way to solve
thanks

Re: Python onConnect proble with windows

Posted: Thursday 25 January 2018 13:28
by jluc2808
any chance to have a solution ?

Re: Python onConnect proble with windows

Posted: Thursday 25 January 2018 13:47
by febalci
Have you checked: viewtopic.php?f=6&t=16168 Also, use 32bit Python3 on Windows, not 64 bit!

Re: Python onConnect proble with windows

Posted: Thursday 25 January 2018 19:25
by jluc2808
i havn't seen this thread before , but he speaks about the reason which produce the error (windows language french) , but not a solution (get back windows with an english language, rather an french language, isn't a solution)

to answer your question yes i'm with python3 32bit (python3 64bit doesn't start anymore with domoticz on windows)

Re: Python onConnect proble with windows

Posted: Friday 16 February 2018 11:02
by emontnemery
A patch has been submitted which should solve this.
Please send a PM if you are willing to test.

Re: Python onConnect proble with windows

Posted: Wednesday 28 February 2018 15:46
by zak45
installed Domoticz 3.8975, solved the problem, thanks to devlopper
https://github.com/domoticz/domoticz/pull/2142