Update bblanchon/ArduinoJson from 7.1.0 to 7.2.0
This commit is contained in:
parent
3b3e6995c2
commit
2f41f43d49
@ -40,7 +40,7 @@ build_unflags =
|
|||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
mathieucarbou/ESPAsyncWebServer @ 3.3.1
|
mathieucarbou/ESPAsyncWebServer @ 3.3.1
|
||||||
bblanchon/ArduinoJson @ 7.1.0
|
bblanchon/ArduinoJson @ 7.2.0
|
||||||
https://github.com/bertmelis/espMqttClient.git#v1.7.0
|
https://github.com/bertmelis/espMqttClient.git#v1.7.0
|
||||||
nrf24/RF24 @ 1.4.9
|
nrf24/RF24 @ 1.4.9
|
||||||
olikraus/U8g2 @ 2.35.30
|
olikraus/U8g2 @ 2.35.30
|
||||||
|
|||||||
@ -61,7 +61,7 @@ void WebApiConfigClass::onConfigDelete(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("delete"))) {
|
if (!(root["delete"].is<bool>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
|
|||||||
@ -103,8 +103,8 @@ void WebApiDeviceClass::onDeviceAdminPost(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("curPin")
|
if (!(root["curPin"].is<JsonObject>()
|
||||||
|| root.containsKey("display"))) {
|
|| root["display"].is<JsonObject>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
|
|||||||
@ -90,12 +90,12 @@ void WebApiDtuClass::onDtuAdminPost(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("serial")
|
if (!(root["serial"].is<String>()
|
||||||
&& root.containsKey("pollinterval")
|
&& root["pollinterval"].is<uint32_t>()
|
||||||
&& root.containsKey("nrf_palevel")
|
&& root["nrf_palevel"].is<uint8_t>()
|
||||||
&& root.containsKey("cmt_palevel")
|
&& root["cmt_palevel"].is<uint8_t>()
|
||||||
&& root.containsKey("cmt_frequency")
|
&& root["cmt_frequency"].is<uint32_t>()
|
||||||
&& root.containsKey("cmt_country"))) {
|
&& root["cmt_country"].is<uint8_t>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
|
|||||||
@ -95,8 +95,8 @@ void WebApiInverterClass::onInverterAdd(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("serial")
|
if (!(root["serial"].is<String>()
|
||||||
&& root.containsKey("name"))) {
|
&& root["name"].is<String>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
@ -165,7 +165,10 @@ void WebApiInverterClass::onInverterEdit(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("id") && root.containsKey("serial") && root.containsKey("name") && root.containsKey("channel"))) {
|
if (!(root["id"].is<uint8_t>()
|
||||||
|
&& root["serial"].is<String>()
|
||||||
|
&& root["name"].is<String>()
|
||||||
|
&& root["channel"].is<JsonArray>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
@ -281,7 +284,7 @@ void WebApiInverterClass::onInverterDelete(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("id"))) {
|
if (!(root["id"].is<uint8_t>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
@ -323,7 +326,7 @@ void WebApiInverterClass::onInverterOrder(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("order"))) {
|
if (!(root["order"].is<JsonArray>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
|
|||||||
@ -64,9 +64,9 @@ void WebApiLimitClass::onLimitPost(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("serial")
|
if (!(root["serial"].is<String>()
|
||||||
&& root.containsKey("limit_value")
|
&& root["limit_value"].is<float>()
|
||||||
&& root.containsKey("limit_type"))) {
|
&& root["limit_type"].is<uint16_t>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
|
|||||||
@ -30,7 +30,7 @@ void WebApiMaintenanceClass::onRebootPost(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("reboot"))) {
|
if (!(root["reboot"].is<bool>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
|
|||||||
@ -107,29 +107,29 @@ void WebApiMqttClass::onMqttAdminPost(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("mqtt_enabled")
|
if (!(root["mqtt_enabled"].is<bool>()
|
||||||
&& root.containsKey("mqtt_hostname")
|
&& root["mqtt_hostname"].is<String>()
|
||||||
&& root.containsKey("mqtt_port")
|
&& root["mqtt_port"].is<uint>()
|
||||||
&& root.containsKey("mqtt_clientid")
|
&& root["mqtt_clientid"].is<String>()
|
||||||
&& root.containsKey("mqtt_username")
|
&& root["mqtt_username"].is<String>()
|
||||||
&& root.containsKey("mqtt_password")
|
&& root["mqtt_password"].is<String>()
|
||||||
&& root.containsKey("mqtt_topic")
|
&& root["mqtt_topic"].is<String>()
|
||||||
&& root.containsKey("mqtt_retain")
|
&& root["mqtt_retain"].is<bool>()
|
||||||
&& root.containsKey("mqtt_tls")
|
&& root["mqtt_tls"].is<bool>()
|
||||||
&& root.containsKey("mqtt_tls_cert_login")
|
&& root["mqtt_tls_cert_login"].is<bool>()
|
||||||
&& root.containsKey("mqtt_client_cert")
|
&& root["mqtt_client_cert"].is<String>()
|
||||||
&& root.containsKey("mqtt_client_key")
|
&& root["mqtt_client_key"].is<String>()
|
||||||
&& root.containsKey("mqtt_lwt_topic")
|
&& root["mqtt_lwt_topic"].is<String>()
|
||||||
&& root.containsKey("mqtt_lwt_online")
|
&& root["mqtt_lwt_online"].is<String>()
|
||||||
&& root.containsKey("mqtt_lwt_offline")
|
&& root["mqtt_lwt_offline"].is<String>()
|
||||||
&& root.containsKey("mqtt_lwt_qos")
|
&& root["mqtt_lwt_qos"].is<uint8_t>()
|
||||||
&& root.containsKey("mqtt_publish_interval")
|
&& root["mqtt_publish_interval"].is<uint32_t>()
|
||||||
&& root.containsKey("mqtt_clean_session")
|
&& root["mqtt_clean_session"].is<bool>()
|
||||||
&& root.containsKey("mqtt_hass_enabled")
|
&& root["mqtt_hass_enabled"].is<bool>()
|
||||||
&& root.containsKey("mqtt_hass_expire")
|
&& root["mqtt_hass_expire"].is<bool>()
|
||||||
&& root.containsKey("mqtt_hass_retain")
|
&& root["mqtt_hass_retain"].is<bool>()
|
||||||
&& root.containsKey("mqtt_hass_topic")
|
&& root["mqtt_hass_topic"].is<String>()
|
||||||
&& root.containsKey("mqtt_hass_individualpanels"))) {
|
&& root["mqtt_hass_individualpanels"].is<bool>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
|
|||||||
@ -88,16 +88,16 @@ void WebApiNetworkClass::onNetworkAdminPost(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("ssid")
|
if (!(root["ssid"].is<String>()
|
||||||
&& root.containsKey("password")
|
&& root["password"].is<String>()
|
||||||
&& root.containsKey("hostname")
|
&& root["hostname"].is<String>()
|
||||||
&& root.containsKey("dhcp")
|
&& root["dhcp"].is<bool>()
|
||||||
&& root.containsKey("ipaddress")
|
&& root["ipaddress"].is<String>()
|
||||||
&& root.containsKey("netmask")
|
&& root["netmask"].is<String>()
|
||||||
&& root.containsKey("gateway")
|
&& root["gateway"].is<String>()
|
||||||
&& root.containsKey("dns1")
|
&& root["dns1"].is<String>()
|
||||||
&& root.containsKey("dns2")
|
&& root["dns2"].is<String>()
|
||||||
&& root.containsKey("aptimeout"))) {
|
&& root["aptimeout"].is<uint>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
|
|||||||
@ -100,11 +100,11 @@ void WebApiNtpClass::onNtpAdminPost(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("ntp_server")
|
if (!(root["ntp_server"].is<String>()
|
||||||
&& root.containsKey("ntp_timezone")
|
&& root["ntp_timezone"].is<String>()
|
||||||
&& root.containsKey("longitude")
|
&& root["longitude"].is<double>()
|
||||||
&& root.containsKey("latitude")
|
&& root["latitude"].is<double>()
|
||||||
&& root.containsKey("sunsettype"))) {
|
&& root["sunsettype"].is<uint8_t>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
@ -193,12 +193,12 @@ void WebApiNtpClass::onNtpTimePost(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("year")
|
if (!(root["year"].is<uint>()
|
||||||
&& root.containsKey("month")
|
&& root["month"].is<uint>()
|
||||||
&& root.containsKey("day")
|
&& root["day"].is<uint>()
|
||||||
&& root.containsKey("hour")
|
&& root["hour"].is<uint>()
|
||||||
&& root.containsKey("minute")
|
&& root["minute"].is<uint>()
|
||||||
&& root.containsKey("second"))) {
|
&& root["second"].is<uint>())) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
|
|||||||
@ -57,9 +57,9 @@ void WebApiPowerClass::onPowerPost(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!(root.containsKey("serial")
|
if (!(root["serial"].is<String>()
|
||||||
&& (root.containsKey("power")
|
&& (root["power"].is<bool>()
|
||||||
|| root.containsKey("restart")))) {
|
|| root["restart"].is<bool>()))) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
@ -84,8 +84,8 @@ void WebApiPowerClass::onPowerPost(AsyncWebServerRequest* request)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root.containsKey("power")) {
|
if (root["power"].is<bool>()) {
|
||||||
uint16_t power = root["power"].as<bool>();
|
bool power = root["power"].as<bool>();
|
||||||
inv->sendPowerControlRequest(power);
|
inv->sendPowerControlRequest(power);
|
||||||
} else {
|
} else {
|
||||||
if (root["restart"].as<bool>()) {
|
if (root["restart"].as<bool>()) {
|
||||||
|
|||||||
@ -48,8 +48,8 @@ void WebApiSecurityClass::onSecurityPost(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
auto& retMsg = response->getRoot();
|
auto& retMsg = response->getRoot();
|
||||||
|
|
||||||
if (!root.containsKey("password")
|
if (!root["password"].is<String>()
|
||||||
&& root.containsKey("allow_readonly")) {
|
&& root["allow_readonly"].is<bool>()) {
|
||||||
retMsg["message"] = "Values are missing!";
|
retMsg["message"] = "Values are missing!";
|
||||||
retMsg["code"] = WebApiError::GenericValueMissing;
|
retMsg["code"] = WebApiError::GenericValueMissing;
|
||||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user