intermediate commit

pull/341/head
Michael Zanetti 2020-07-02 22:54:00 +02:00
parent 1ce5d5980d
commit 43ed283340
1 changed files with 6 additions and 1 deletions

View File

@ -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)))