mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-02-23 07:43:17 +00:00
Send price config to cloud
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
#warning "Unsupported board type"
|
||||
#endif
|
||||
|
||||
#define CC_BUF_SIZE 2048
|
||||
#define CC_BUF_SIZE 4096
|
||||
|
||||
static const char CC_JSON_POWER[] PROGMEM = ",\"%s\":{\"P\":%lu,\"Q\":%lu}";
|
||||
static const char CC_JSON_POWER_LIST3[] PROGMEM = ",\"%s\":{\"P\":%lu,\"Q\":%lu,\"tP\":%.3f,\"tQ\":%.3f}";
|
||||
|
||||
@@ -257,7 +257,6 @@ void CloudConnector::update(AmsData& data, EnergyAccounting& ea) {
|
||||
dns1.toString().c_str(),
|
||||
dns2.toString().c_str()
|
||||
);
|
||||
sendData = pos > CC_BUF_SIZE - 768;
|
||||
} else if(lastPriceConfig == 0) {
|
||||
pos += snprintf_P(clearBuffer+pos, CC_BUF_SIZE-pos, PSTR(",\"price\":{\"area\":\"%s\",\"currency\":\"%s\",\"modifiers\":["), priceConfig.area, priceConfig.currency);
|
||||
if(ps != NULL) {
|
||||
@@ -314,7 +313,7 @@ void CloudConnector::update(AmsData& data, EnergyAccounting& ea) {
|
||||
}
|
||||
pos += snprintf_P(clearBuffer+pos, CC_BUF_SIZE-pos, PSTR("]}"));
|
||||
lastPriceConfig = now;
|
||||
sendData = pos > CC_BUF_SIZE - 768;
|
||||
sendData = false;
|
||||
} else if(lastEac == 0) {
|
||||
pos += snprintf_P(clearBuffer+pos, CC_BUF_SIZE-pos, PSTR(",\"accounting\":{\"hours\":%d,\"thresholds\":[%d,%d,%d,%d,%d,%d,%d,%d,%d]}"),
|
||||
eac.hours,
|
||||
@@ -329,7 +328,6 @@ void CloudConnector::update(AmsData& data, EnergyAccounting& ea) {
|
||||
eac.thresholds[8]
|
||||
);
|
||||
lastEac = now;
|
||||
sendData = pos > CC_BUF_SIZE - 768;
|
||||
}
|
||||
|
||||
if(sendData) {
|
||||
|
||||
Reference in New Issue
Block a user