Python onConnect proble with windows

Python and python framework

Moderator: leecollings

Post Reply
jluc2808
Posts: 49
Joined: Thursday 18 January 2018 6:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Python onConnect proble with windows

Post 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
jluc2808
Posts: 49
Joined: Thursday 18 January 2018 6:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python onConnect proble with windows

Post by jluc2808 »

any chance to have a solution ?
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python onConnect proble with windows

Post by febalci »

Have you checked: viewtopic.php?f=6&t=16168 Also, use 32bit Python3 on Windows, not 64 bit!
jluc2808
Posts: 49
Joined: Thursday 18 January 2018 6:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python onConnect proble with windows

Post 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)
emontnemery
Posts: 38
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python onConnect proble with windows

Post by emontnemery »

A patch has been submitted which should solve this.
Please send a PM if you are willing to test.
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python onConnect proble with windows

Post by zak45 »

installed Domoticz 3.8975, solved the problem, thanks to devlopper
https://github.com/domoticz/domoticz/pull/2142
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest