For my Fibaro rollershutters I can trigger the calibration via REST interface.
Basically it is that:
# trigger calibration
HTTPString = "http://" + Login + Service + "/rest/things/" + Device + "/config"
Parameter = "{\"config_29_1\": 1}"
HTTP.sendHttpPutRequest(HTTPString, "application/json", Parameter)
I want to replace that by using the API directly.
ConfID = u"config_29_1"
# get thing
Thing = things.get(ThingUID(UID))
# get configuration of thing
Config = Thing.getConfiguration()
LogAction.logInfo(LOGGER, "{}: {}".format(UID, Config))
# change parameter in configuration
Config.put(ConfID, 1)
# apply configuration
Thing.setConfiguration(Config)
# get new configuration – as proof that it is applied
C = Thing.getConfiguration()
LogAction.logInfo(LOGGER, "{}: {}".format(UID, C))
# here should the calibration happen
sleep(15)
# revert change of parameter
Config.put(ConfID, 0)
Thing.setConfiguration(Config)
The parameter is set as expected, also visible via REST interface.
But the action of calibration is not executed as expected. Is there a step missing to really apply the changed configuration?