|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2016-2019 dresden elektronik ingenieurtechnik gmbh. |
| 2 | + * Copyright (c) 2016-2024 dresden elektronik ingenieurtechnik gmbh. |
3 | 3 | * All rights reserved.
|
4 | 4 | *
|
5 | 5 | * The software in this package is published under the terms of the BSD
|
@@ -365,7 +365,7 @@ int DeRestPluginPrivate::setScheduleAttributes(const ApiRequest &req, ApiRespons
|
365 | 365 |
|
366 | 366 | if (!cmd.isEmpty() && cmd.contains("address") && cmd.contains("method") && cmd.contains("body"))
|
367 | 367 | {
|
368 |
| - i->command = deCONZ::jsonStringFromMap(cmd); |
| 368 | + i->command = Json::serialize(cmd); |
369 | 369 | i->jsonMap["command"] = map["command"];
|
370 | 370 |
|
371 | 371 | QVariantMap rspItem;
|
@@ -802,7 +802,7 @@ bool DeRestPluginPrivate::jsonToSchedule(const QString &jsonString, Schedule &sc
|
802 | 802 | return false;
|
803 | 803 | }
|
804 | 804 |
|
805 |
| - schedule.command = deCONZ::jsonStringFromMap(cmd); |
| 805 | + schedule.command = Json::serialize(cmd); |
806 | 806 | }
|
807 | 807 | else
|
808 | 808 | {
|
@@ -1146,7 +1146,7 @@ void DeRestPluginPrivate::scheduleTimerFired()
|
1146 | 1146 | {
|
1147 | 1147 | if (i->endtime.isValid() && i->endtime > now)
|
1148 | 1148 | {
|
1149 |
| - DBG_Printf(DBG_INFO, "schedule %s timeout in %d s\n", qPrintable(i->id), now.secsTo(i->endtime)); |
| 1149 | + DBG_Printf(DBG_INFO, "schedule %s timeout in %d s\n", qPrintable(i->id), (int)now.secsTo(i->endtime)); |
1150 | 1150 | continue;
|
1151 | 1151 | }
|
1152 | 1152 | else if (i->endtime.isValid())
|
@@ -1226,7 +1226,7 @@ void DeRestPluginPrivate::scheduleTimerFired()
|
1226 | 1226 | {
|
1227 | 1227 | i->status = QLatin1String("disabled");
|
1228 | 1228 | i->jsonMap["status"] = i->status;
|
1229 |
| - i->jsonString = deCONZ::jsonStringFromMap(i->jsonMap); |
| 1229 | + i->jsonString = Json::serialize(i->jsonMap); |
1230 | 1230 | if (i->autodelete)
|
1231 | 1231 | {
|
1232 | 1232 | DBG_Printf(DBG_INFO, "schedule %s: %s deleted (too old)\n", qPrintable(i->id), qPrintable(i->name));
|
@@ -1260,7 +1260,7 @@ void DeRestPluginPrivate::scheduleTimerFired()
|
1260 | 1260 | {
|
1261 | 1261 | i->status = QLatin1String("disabled");
|
1262 | 1262 | i->jsonMap["status"] = i->status;
|
1263 |
| - i->jsonString = deCONZ::jsonStringFromMap(i->jsonMap); |
| 1263 | + i->jsonString = Json::serialize(i->jsonMap); |
1264 | 1264 | }
|
1265 | 1265 | queSaveDb(DB_SCHEDULES, DB_SHORT_SAVE_DELAY);
|
1266 | 1266 | }
|
@@ -1355,7 +1355,7 @@ void DeRestPluginPrivate::scheduleTimerFired()
|
1355 | 1355 | }
|
1356 | 1356 | QString method = cmd["method"].toString();
|
1357 | 1357 | QString address = cmd["address"].toString();
|
1358 |
| - QString content = deCONZ::jsonStringFromMap(cmd["body"].toMap()); |
| 1358 | + QString content = Json::serialize(cmd["body"].toMap()); |
1359 | 1359 |
|
1360 | 1360 | // check if fields contain data
|
1361 | 1361 | if (method.isEmpty() || address.isEmpty() || content.isEmpty())
|
|
0 commit comments