Apply code formatter without functional changes
This commit is contained in:
parent
a06a56a490
commit
658a42db80
@ -2,11 +2,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "WebApi_config.h"
|
||||
#include "WebApi_device.h"
|
||||
#include "WebApi_devinfo.h"
|
||||
#include "WebApi_dtu.h"
|
||||
#include "WebApi_eventlog.h"
|
||||
#include "WebApi_firmware.h"
|
||||
#include "WebApi_device.h"
|
||||
#include "WebApi_inverter.h"
|
||||
#include "WebApi_limit.h"
|
||||
#include "WebApi_maintenance.h"
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#pragma once
|
||||
|
||||
#include "HoymilesRadio_NRF.h"
|
||||
#include "HoymilesRadio_CMT.h"
|
||||
#include "HoymilesRadio_NRF.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
#include "types.h"
|
||||
#include <Print.h>
|
||||
|
||||
@ -35,11 +35,11 @@ void ActivePowerControlCommand::setActivePowerLimit(float limit, PowerLimitContr
|
||||
|
||||
// limit
|
||||
_payload[12] = (l >> 8) & 0xff;
|
||||
_payload[13] = (l) & 0xff;
|
||||
_payload[13] = (l)&0xff;
|
||||
|
||||
// type
|
||||
_payload[14] = (type >> 8) & 0xff;
|
||||
_payload[15] = (type) & 0xff;
|
||||
_payload[15] = (type)&0xff;
|
||||
|
||||
udpateCRC(CRC_SIZE);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "../Hoymiles.h"
|
||||
#include <cstring>
|
||||
|
||||
const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMessages = {{
|
||||
const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMessages = { {
|
||||
{ AlarmMessageType_t::ALL, 1, "Inverter start" },
|
||||
{ AlarmMessageType_t::ALL, 2, "DTU command failed" },
|
||||
{ AlarmMessageType_t::ALL, 73, "Temperature >80°C" }, // https://github.com/tbnobody/OpenDTU/discussions/590#discussioncomment-6049750
|
||||
@ -84,7 +84,7 @@ const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMe
|
||||
{ AlarmMessageType_t::ALL, 5200, "Firmware error" },
|
||||
{ AlarmMessageType_t::ALL, 8310, "Shut down" },
|
||||
{ AlarmMessageType_t::ALL, 9000, "Microinverter is suspected of being stolen" },
|
||||
}};
|
||||
} };
|
||||
|
||||
void AlarmLogParser::clearBuffer()
|
||||
{
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
#pragma once
|
||||
#include "Parser.h"
|
||||
#include <Arduino.h>
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
|
||||
#define ALARM_LOG_ENTRY_COUNT 15
|
||||
#define ALARM_LOG_ENTRY_SIZE 12
|
||||
|
||||
@ -300,7 +300,7 @@ void ConfigurationClass::migrate()
|
||||
config.Mqtt_PublishInterval = mqtt["publish_invterval"];
|
||||
}
|
||||
|
||||
if (config.Cfg_Version < 0x00011900) {
|
||||
if (config.Cfg_Version < 0x00011900) {
|
||||
JsonObject dtu = doc["dtu"];
|
||||
config.Dtu_NrfPaLevel = dtu["pa_level"];
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
// for all generations, this is equivalent to SPI3_HOST in the lower level driver
|
||||
// For ESP32-C2, the only externally usable HW SPI controller is SPI2, its signal names
|
||||
// being prefixed with FSPI.
|
||||
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
|
||||
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
|
||||
#define SPI_NRF HSPI
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||
#define SPI_NRF FSPI
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
*/
|
||||
#include "MqttSettings.h"
|
||||
#include "MessageOutput.h"
|
||||
#include "Configuration.h"
|
||||
#include "MessageOutput.h"
|
||||
|
||||
MqttSettingsClass::MqttSettingsClass()
|
||||
{
|
||||
|
||||
@ -159,8 +159,7 @@ void NetworkSettingsClass::loop()
|
||||
setStaticIp();
|
||||
setHostname();
|
||||
}
|
||||
} else
|
||||
if (_networkMode != network_mode::WiFi) {
|
||||
} else if (_networkMode != network_mode::WiFi) {
|
||||
// Do stuff when switching to Ethernet mode
|
||||
MessageOutput.println("Switch to WiFi mode");
|
||||
_networkMode = network_mode::WiFi;
|
||||
@ -249,8 +248,7 @@ void NetworkSettingsClass::setHostname()
|
||||
WiFi.mode(WIFI_MODE_APSTA);
|
||||
WiFi.mode(WIFI_MODE_STA);
|
||||
setupMode();
|
||||
}
|
||||
else if (_networkMode == network_mode::Ethernet) {
|
||||
} else if (_networkMode == network_mode::Ethernet) {
|
||||
if (ETH.setHostname(getHostname().c_str())) {
|
||||
MessageOutput.println("done");
|
||||
} else {
|
||||
@ -276,8 +274,7 @@ void NetworkSettingsClass::setStaticIp()
|
||||
IPAddress(Configuration.get().WiFi_Dns2));
|
||||
MessageOutput.println("done");
|
||||
}
|
||||
}
|
||||
else if (_networkMode == network_mode::Ethernet) {
|
||||
} else if (_networkMode == network_mode::Ethernet) {
|
||||
if (Configuration.get().WiFi_Dhcp) {
|
||||
MessageOutput.print("Configuring Ethernet DHCP IP... ");
|
||||
ETH.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE);
|
||||
|
||||
@ -443,7 +443,7 @@ void WebApiInverterClass::onInverterOrder(AsyncWebServerRequest* request)
|
||||
// The order array contains list or id in the right order
|
||||
JsonArray orderArray = root["order"].as<JsonArray>();
|
||||
uint8_t order = 0;
|
||||
for(JsonVariant id : orderArray) {
|
||||
for (JsonVariant id : orderArray) {
|
||||
uint8_t inverter_id = id.as<uint8_t>();
|
||||
if (inverter_id < INV_MAX_COUNT) {
|
||||
INVERTER_CONFIG_T& inverter = Configuration.get().Inverter[inverter_id];
|
||||
|
||||
@ -221,8 +221,8 @@ void WebApiMqttClass::onMqttAdminPost(AsyncWebServerRequest* request)
|
||||
}
|
||||
|
||||
if (root["mqtt_root_ca_cert"].as<String>().length() > MQTT_MAX_CERT_STRLEN
|
||||
|| root["mqtt_client_cert"].as<String>().length() > MQTT_MAX_CERT_STRLEN
|
||||
|| root["mqtt_client_key"].as<String>().length() > MQTT_MAX_CERT_STRLEN) {
|
||||
|| root["mqtt_client_cert"].as<String>().length() > MQTT_MAX_CERT_STRLEN
|
||||
|| root["mqtt_client_key"].as<String>().length() > MQTT_MAX_CERT_STRLEN) {
|
||||
retMsg["message"] = "Certificates must not be longer than " STR(MQTT_MAX_CERT_STRLEN) " characters!";
|
||||
retMsg["code"] = WebApiError::MqttCertificateLength;
|
||||
retMsg["param"]["max"] = MQTT_MAX_CERT_STRLEN;
|
||||
|
||||
@ -143,8 +143,7 @@ void WebApiPrometheusClass::addPanelInfo(AsyncResponseStream* stream, String& se
|
||||
idx,
|
||||
inv->name(),
|
||||
channel,
|
||||
config.Inverter[idx].channel[channel].Name
|
||||
);
|
||||
config.Inverter[idx].channel[channel].Name);
|
||||
|
||||
if (printHelp) {
|
||||
stream->print("# HELP opendtu_MaxPower panel maximum output power\n");
|
||||
@ -155,8 +154,7 @@ void WebApiPrometheusClass::addPanelInfo(AsyncResponseStream* stream, String& se
|
||||
idx,
|
||||
inv->name(),
|
||||
channel,
|
||||
config.Inverter[idx].channel[channel].MaxChannelPower
|
||||
);
|
||||
config.Inverter[idx].channel[channel].MaxChannelPower);
|
||||
|
||||
if (printHelp) {
|
||||
stream->print("# HELP opendtu_YieldTotalOffset panel yield offset (for used inverters)\n");
|
||||
@ -167,6 +165,5 @@ void WebApiPrometheusClass::addPanelInfo(AsyncResponseStream* stream, String& se
|
||||
idx,
|
||||
inv->name(),
|
||||
channel,
|
||||
config.Inverter[idx].channel[channel].YieldTotalOffset
|
||||
);
|
||||
config.Inverter[idx].channel[channel].YieldTotalOffset);
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ void WebApiWebappClass::init(AsyncWebServer* server)
|
||||
#ifdef AUTO_GIT_HASH
|
||||
// check client If-None-Match header vs ETag/AUTO_GIT_HASH
|
||||
bool eTagMatch = false;
|
||||
if(request->hasHeader("If-None-Match")){
|
||||
if (request->hasHeader("If-None-Match")) {
|
||||
AsyncWebHeader* h = request->getHeader("If-None-Match");
|
||||
if (strncmp(AUTO_GIT_HASH, h->value().c_str(), strlen(AUTO_GIT_HASH)) == 0) {
|
||||
eTagMatch = true;
|
||||
|
||||
@ -169,9 +169,7 @@ void WebApiWsLiveClass::generateJsonResponse(JsonVariant& root)
|
||||
JsonObject hintObj = root.createNestedObject("hints");
|
||||
struct tm timeinfo;
|
||||
hintObj["time_sync"] = !getLocalTime(&timeinfo, 5);
|
||||
hintObj["radio_problem"] =
|
||||
(Hoymiles.getRadioNrf()->isInitialized() && (!Hoymiles.getRadioNrf()->isConnected() || !Hoymiles.getRadioNrf()->isPVariant())) ||
|
||||
(Hoymiles.getRadioCmt()->isInitialized() && (!Hoymiles.getRadioCmt()->isConnected()));
|
||||
hintObj["radio_problem"] = (Hoymiles.getRadioNrf()->isInitialized() && (!Hoymiles.getRadioNrf()->isConnected() || !Hoymiles.getRadioNrf()->isPVariant())) || (Hoymiles.getRadioCmt()->isInitialized() && (!Hoymiles.getRadioCmt()->isConnected()));
|
||||
if (!strcmp(Configuration.get().Security_Password, ACCESS_POINT_PASSWORD)) {
|
||||
hintObj["default_password"] = true;
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user