Fixed cloud bugs

This commit is contained in:
Gunnar Skjold
2024-01-06 10:05:44 +01:00
parent 6012c19fc4
commit bad107926c
5 changed files with 6 additions and 10 deletions

View File

@@ -46,9 +46,9 @@ bool CloudConnector::setup(CloudConfig& config, MeterConfig& meter, HwTools* hw)
this->hw = hw;
this->maxPwr = 0;
this->distributionSystem = distributionSystem;
this->mainFuse = mainFuse;
this->productionCapacity = productionCapacity;
this->distributionSystem = meter.distributionSystem;
this->mainFuse = meter.mainFuse;
this->productionCapacity = meter.productionCapacity;
this->initialized = false;
@@ -286,7 +286,7 @@ void CloudConnector::update(AmsData& data, EnergyAccounting& ea) {
meterManufacturer(data.getMeterType()).c_str(),
data.getMeterModel().c_str(),
data.getMeterId().c_str(),
distributionSystemStr(distributionSystem),
distributionSystemStr(distributionSystem).c_str(),
mainFuse,
maxPwr,
productionCapacity

View File

@@ -108,7 +108,7 @@
t: '', h: '', n: ''
},
c: {
e: false, i: null, s: null, es: null
e: false, i: null, es: null
}
};
configurationStore.subscribe(update => {

View File

@@ -1,5 +1,4 @@
"c": {
"e" : %s,
"i" : "%s",
"es": %s
}

View File

@@ -39,6 +39,7 @@
#include "html/conf_ui_json.h"
#include "html/conf_cloud_json.h"
#include "html/firmware_html.h"
#include <ESPRandom.h>
#if defined(ESP32)
#include <esp_task_wdt.h>
@@ -1094,7 +1095,6 @@ void AmsWebServer::configurationJson() {
server.sendContent(buf);
snprintf_P(buf, BufferSize, CONF_CLOUD_JSON,
cloud.enabled ? "true" : "false",
cloud.clientId,
#if defined(ESP32) && defined(ENERGY_SPEEDOMETER_PASS)
sysConfig.energyspeedometer == 7 ? "true" : "false"
#else

View File

@@ -312,7 +312,6 @@ void setup() {
bool shared = false;
Serial.flush();
Serial.end();
MeterConfig meterConfig;
config.getMeterConfig(meterConfig);
if(meterConfig.rxPin == 3) {
shared = true;
@@ -682,7 +681,6 @@ void loop() {
}
if(config.isMeterChanged()) {
MeterConfig meterConfig;
config.getMeterConfig(meterConfig);
if(meterConfig.source = METER_SOURCE_SERIAL) {
switch(meterConfig.parser) {
@@ -1099,7 +1097,6 @@ bool readHanPort() {
return false;
}
if(mc->isConfigChanged()) {
MeterConfig meterConfig;
mc->getCurrentConfig(meterConfig);
config.setMeterConfig(meterConfig);
}