Classes work but....
This commit is contained in:
12
plugin.py
12
plugin.py
@ -100,8 +100,6 @@ class Maximum:
|
|||||||
class BasePlugin:
|
class BasePlugin:
|
||||||
#enabled = False
|
#enabled = False
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# Default hearbeat is 10 seconds, then 30 samples for the 5 minutes
|
|
||||||
self.max_samples = 30
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def onStart(self):
|
def onStart(self):
|
||||||
@ -277,11 +275,11 @@ class BasePlugin:
|
|||||||
# Scale factor / 100
|
# Scale factor / 100
|
||||||
#value = str ( round (value / 100, 3))
|
#value = str ( round (value / 100, 3))
|
||||||
Domoticz.Debug("Value after conversion : "+str(value))
|
Domoticz.Debug("Value after conversion : "+str(value))
|
||||||
Domoticz.Debug("-> Calculating average")
|
Domoticz.Debug("-> Calculating average")
|
||||||
m = Average()
|
m = Average()
|
||||||
m.update(value)
|
m.update(value)
|
||||||
value = m.get()
|
value = m.get()
|
||||||
Domotice.Debug(" = {}".format(value))
|
Domoticz.Debug(" = {}".format(value))
|
||||||
Devices[6].Update(1, str(value))
|
Devices[6].Update(1, str(value))
|
||||||
if value > 0.0:
|
if value > 0.0:
|
||||||
import_w = value
|
import_w = value
|
||||||
|
|||||||
Reference in New Issue
Block a user