intermediate commit
This commit is contained in:
parent
1ce5d5980d
commit
43ed283340
@ -9,11 +9,16 @@ def configValueChanged(paramTypeId, value):
|
|||||||
logger.log("Plugin config value changed:", paramTypeId, value)
|
logger.log("Plugin config value changed:", paramTypeId, value)
|
||||||
if paramTypeId == pyMockPluginAutoThingCountParamTypeId:
|
if paramTypeId == pyMockPluginAutoThingCountParamTypeId:
|
||||||
logger.log("Auto Thing Count plugin config changed:", value, "Currently there are:", len(autoThings()), "auto things")
|
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")
|
logger.log("Creating new auto thing")
|
||||||
descriptor = nymea.ThingDescriptor(pyMockAutoThingClassId, "Python Mock auto thing")
|
descriptor = nymea.ThingDescriptor(pyMockAutoThingClassId, "Python Mock auto thing")
|
||||||
autoThingsAppeared([descriptor])
|
autoThingsAppeared([descriptor])
|
||||||
|
|
||||||
|
for i in range(len(value), things):
|
||||||
|
logger.log("Removing auto thing")
|
||||||
|
autoThingDisappeared(things[i].id)
|
||||||
|
|
||||||
|
|
||||||
def startMonitoringAutoThings():
|
def startMonitoringAutoThings():
|
||||||
logger.log("Start monitoring auto things. Have %i auto devices. Need %i." % (len(autoThings()), configValue(pyMockPluginAutoThingCountParamTypeId)))
|
logger.log("Start monitoring auto things. Have %i auto devices. Need %i." % (len(autoThings()), configValue(pyMockPluginAutoThingCountParamTypeId)))
|
||||||
|
|||||||
Reference in New Issue
Block a user