mirror of https://github.com/nymea/nymea.git
intermediate commit
parent
1ce5d5980d
commit
43ed283340
|
|
@ -9,11 +9,16 @@ def configValueChanged(paramTypeId, value):
|
|||
logger.log("Plugin config value changed:", paramTypeId, value)
|
||||
if paramTypeId == pyMockPluginAutoThingCountParamTypeId:
|
||||
logger.log("Auto Thing Count plugin config changed:", value, "Currently there are:", len(autoThings()), "auto things")
|
||||
for i in range(value, len(myThings())):
|
||||
things = autoThings();
|
||||
for i in range(len(things), value):
|
||||
logger.log("Creating new auto thing")
|
||||
descriptor = nymea.ThingDescriptor(pyMockAutoThingClassId, "Python Mock auto thing")
|
||||
autoThingsAppeared([descriptor])
|
||||
|
||||
for i in range(len(value), things):
|
||||
logger.log("Removing auto thing")
|
||||
autoThingDisappeared(things[i].id)
|
||||
|
||||
|
||||
def startMonitoringAutoThings():
|
||||
logger.log("Start monitoring auto things. Have %i auto devices. Need %i." % (len(autoThings()), configValue(pyMockPluginAutoThingCountParamTypeId)))
|
||||
|
|
|
|||
Loading…
Reference in New Issue