mirror of
https://github.com/nymea/nymea-plugins.git
synced 2026-08-05 03:33:51 +02:00
Merge PR #791: ESPSomfyRTS: Fix step up/down for blinds
This commit is contained in:
commit
ee46c582a9
@ -205,8 +205,10 @@ void IntegrationPluginEspSomfyRts::executeAction(ThingActionInfo *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QNetworkRequest request(somfy->shadeCommandUrl());
|
QNetworkRequest request(somfy->shadeCommandUrl());
|
||||||
|
const QByteArray requestData = QJsonDocument::fromVariant(requestMap).toJson();
|
||||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||||
QNetworkReply *reply = hardwareManager()->networkManager()->put(request, QJsonDocument::fromVariant(requestMap).toJson());
|
qCDebug(dcESPSomfyRTS()) << "Executing command on" << info->thing() << qUtf8Printable(requestData);
|
||||||
|
QNetworkReply *reply = hardwareManager()->networkManager()->put(request, requestData);
|
||||||
connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater);
|
connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater);
|
||||||
connect(reply, &QNetworkReply::finished, info, [reply, info](){
|
connect(reply, &QNetworkReply::finished, info, [reply, info](){
|
||||||
|
|
||||||
@ -260,6 +262,12 @@ void IntegrationPluginEspSomfyRts::executeAction(ThingActionInfo *info)
|
|||||||
int percentage = calculatePercentageFromAngle(minValue, maxValue, angle);
|
int percentage = calculatePercentageFromAngle(minValue, maxValue, angle);
|
||||||
qCDebug(dcESPSomfyRTS()) << "######" << percentage;
|
qCDebug(dcESPSomfyRTS()) << "######" << percentage;
|
||||||
requestMap.insert("target", percentage);
|
requestMap.insert("target", percentage);
|
||||||
|
} else if (action.actionTypeId() == venetianBlindStepUpActionTypeId) {
|
||||||
|
requestMap.insert("command", EspSomfyRts::getShadeCommandString(EspSomfyRts::ShadeCommandStepUp));
|
||||||
|
requestMap.insert("stepSize", thing->setting(venetianBlindSettingsStepSizeParamTypeId).toUInt());
|
||||||
|
} else if (action.actionTypeId() == venetianBlindStepDownActionTypeId) {
|
||||||
|
requestMap.insert("command", EspSomfyRts::getShadeCommandString(EspSomfyRts::ShadeCommandStepDown));
|
||||||
|
requestMap.insert("stepSize", thing->setting(venetianBlindSettingsStepSizeParamTypeId).toUInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
|
|||||||
@ -157,6 +157,17 @@
|
|||||||
"type": "uint"
|
"type": "uint"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"settingsTypes": [
|
||||||
|
{
|
||||||
|
"id": "ad505c57-6029-40a8-a610-f909e1f61f06",
|
||||||
|
"name": "stepSize",
|
||||||
|
"displayName": "Step size",
|
||||||
|
"type": "uint",
|
||||||
|
"defaultValue": 1,
|
||||||
|
"minValue": 1,
|
||||||
|
"maxValue": 127
|
||||||
|
}
|
||||||
|
],
|
||||||
"stateTypes": [
|
"stateTypes": [
|
||||||
{
|
{
|
||||||
"id": "ade34009-bb6c-41fc-86dc-fc59c9cbca2f",
|
"id": "ade34009-bb6c-41fc-86dc-fc59c9cbca2f",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user