The script only needs the following to do it's work.
Code: Select all
import requests
import re
from requests.auth import HTTPBasicAuth
Code: Select all
2019-07-21 09:46:14.138 Status: (Omnik) Started.
2019-07-21 09:47:24.154 Status: (Omnik) Stop directive received.
2019-07-21 09:47:24.154 Status: (Omnik) Stopping threads.I've read the issue of a missing import.
Python 'import' that are unsuccessful will stop the entrie plugin from importing and running unless they are wrapped within a 'try'/'except' pair. If a module is not found the Plugin Framework will provide as much information as it gets from Python. For example, an attempt to import fakemodule in a plugin called 'Google Devices' will be reported like this in the Domoticz log:
Code: Select all
try:
import Domoticz
except ImportError:
import fakeDomoticz as Domoticz
class BasePlugin:
enabled = False
lastPolled = 0
lastResponse = 0
def __init__(self):
return
def onStart(self):
if Parameters["Mode6"] == "Debug":
Domoticz.Debugging(1)
Domoticz.Log("Debugger started, use 'telnet 0.0.0.0 4444' to connect")
import rpdb
rpdb.set_trace()
else:
Domoticz.Log("onStart called")
Domoticz.Debugging(0)
import requests
import re
from requests.auth import HTTPBasicAuth
Domoticz.Log("onStart called")
Domoticz.Log("Debugging Disabled")
Code: Select all
(to) 0.0.0.0 4444
Trying 0.0.0.0...
Connected to 0.0.0.0.
Escape character is '^]'.
> /home/pi/domoticz/plugins/Domoticz-Omnik/plugin.py(92)onStart()
-> import requests
(Pdb)Code: Select all
r = requests.get(url, auth=HTTPBasicAuth(Parameters["Username"], Parameters["Password"]))