Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with onMessage function #3

Open
miczmc opened this issue Dec 9, 2018 · 1 comment
Open

Error with onMessage function #3

miczmc opened this issue Dec 9, 2018 · 1 comment

Comments

@miczmc
Copy link
Contributor

miczmc commented Dec 9, 2018

2018-12-09 23:34:04.899 (MELCloud) Update unit XXXXXXX information.
2018-12-09 23:34:04.899 Error: (MELCloud) 'onMessage' failed 'UnboundLocalError':'local variable 'setModeLevel' referenced before assignment'.
2018-12-09 23:34:04.899 Error: (MELCloud) ----> Line 444 in /root/domoticz/plugins/Melcloud/plugin.py, function onMessage
2018-12-09 23:34:04.899 Error: (MELCloud) ----> Line 194 in /root/domoticz/plugins/Melcloud/plugin.py, function onMessage
2018-12-09 23:34:04.899 Error: (MELCloud) ----> Line 406 in /root/domoticz/plugins/Melcloud/plugin.py, function domoticz_sync_switchs

@CousinsP
Copy link

CousinsP commented Apr 3, 2019

I don't know Python, but I think I can see the problem, In lines 400-404 it's possible that setModeLevel doesn't get set, and is used later on. I just need to find out how if then else constructs work in Python, then might be able to resolve. The variable probably needs setting to a default at the beginning of the domoticz_sync_switchs function. But what should the default be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants