Remove warnings

This commit is contained in:
2023-10-16 00:30:15 +02:00
parent c217602b28
commit 0ed813515a

35
run.py
View File

@@ -1,7 +1,8 @@
"""Fake script simulating Domoticz"""
#pylint: disable=line-too-long
import os
import time
import Domoticz
import plugin
def function_read_properties(filename:str, sep:str='=', comment_char:str='#')->dict:
"""Convert a .properties file into a dictionary"""
@@ -18,32 +19,32 @@ def function_read_properties(filename:str, sep:str='=', comment_char:str='#')->d
return dictionary
"""Read Parameter file? Format should be:
Address=xxx
Port=xxx
Username=xxx
Password=xxx
Mode1=xxx
Mode2=xxx
Mode3=xxx
Mode4=xxx
Mode5=xxx
Mode6=xxx
"""
# """Read Parameter file? Format should be:
# Address=xxx
# Port=xxx
# Username=xxx
# Password=xxx
# Mode1=xxx
# Mode2=xxx
# Mode3=xxx
# Mode4=xxx
# Mode5=xxx
# Mode6=xxx
# """
Parameters = function_read_properties(os.path.join(os.path.dirname(__file__), "parameters.properties"))
Images = Domoticz.Images
Devices = Domoticz.Devices
with open("./plugin.py", 'rb') as fileobj:
exec(compile(fileobj.read(), "plugin.py", 'exec'), globals(), globals())
exec(compile(fileobj.read(), "plugin.py", 'exec'), globals(), globals()) #pylint: disable=exec-used
onStart()
onStart() #pylint: disable=undefined-variable # type: ignore
try:
while True:
Domoticz.Log("## Plugin Heartbeat ##")
onHeartbeat()
onHeartbeat() #pylint: disable=undefined-variable # type: ignore
time.sleep(Domoticz.domo.GetHeartbeat())
finally:
onStop()
onStop() #pylint: disable=undefined-variable # type: ignore