Add support of DomoticzEx
This commit is contained in:
7
run.py
7
run.py
@@ -3,6 +3,7 @@
|
||||
import os
|
||||
import time
|
||||
import Domoticz
|
||||
import DomoticzEx
|
||||
|
||||
def function_read_properties(filename:str, sep:str='=', comment_char:str='#')->dict:
|
||||
"""Convert a .properties file into a dictionary"""
|
||||
@@ -35,6 +36,7 @@ Parameters = function_read_properties(os.path.join(os.path.dirname(__file__), "p
|
||||
|
||||
Images = Domoticz.Images
|
||||
Devices = Domoticz.Devices
|
||||
DomoticzEx.Devices = Devices #Domoticz and DomoticsEx share the same "Devices"
|
||||
|
||||
with open("./plugin.py", 'rb') as fileobj:
|
||||
exec(compile(fileobj.read(), "plugin.py", 'exec'), globals(), globals()) #pylint: disable=exec-used
|
||||
@@ -47,4 +49,7 @@ try:
|
||||
onHeartbeat() #pylint: disable=undefined-variable # type: ignore
|
||||
time.sleep(Domoticz.domo.GetHeartbeat())
|
||||
finally:
|
||||
onStop() #pylint: disable=undefined-variable # type: ignore
|
||||
try:
|
||||
onStop() #pylint: disable=undefined-variable # type: ignore
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user