mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-01 18:21:39 +02:00
0.8.130
* add timestamp to JSON output #1707 * restart Ahoy using MqTT #1667
This commit is contained in:
parent
a8117eeb8a
commit
24ceb3e97e
4 changed files with 10 additions and 2 deletions
|
@ -5,6 +5,8 @@
|
|||
* merge PR: Power limit command accelerated #1704
|
||||
* merge PR: reduce update cycle of ePaper from 5 to 10 seconds #1706
|
||||
* merge PR: small fixes in different files #1711
|
||||
* add timestamp to JSON output #1707
|
||||
* restart Ahoy using MqTT #1667
|
||||
|
||||
## 0.8.129 - 2024-07-11
|
||||
* sort alarms ascending #1471
|
||||
|
|
|
@ -285,6 +285,9 @@ class PubMqtt {
|
|||
tickerMinute();
|
||||
publish(mLwtTopic.data(), mqttStr[MQTT_STR_LWT_CONN], true, false);
|
||||
|
||||
snprintf(mVal.data(), mVal.size(), "ctrl/restart_ahoy");
|
||||
subscribe(mVal.data());
|
||||
|
||||
for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) {
|
||||
snprintf(mVal.data(), mVal.size(), "ctrl/limit/%d", i);
|
||||
subscribe(mVal.data(), QOS_2);
|
||||
|
@ -386,9 +389,9 @@ class PubMqtt {
|
|||
pos++;
|
||||
}
|
||||
|
||||
/*char out[128];
|
||||
char out[128];
|
||||
serializeJson(root, out, 128);
|
||||
DPRINTLN(DBG_INFO, "json: " + String(out));*/
|
||||
DPRINTLN(DBG_INFO, "json: " + String(out));
|
||||
(mSubscriptionCb)(root);
|
||||
|
||||
mRxCnt++;
|
||||
|
|
|
@ -231,6 +231,7 @@ class PubMqttIvData {
|
|||
publish = true;
|
||||
|
||||
if (publish) {
|
||||
doc[F("ts")] = rec->ts;
|
||||
// if next channel or end->publish
|
||||
serializeJson(doc, mVal.data(), mVal.size());
|
||||
snprintf(mSubTopic.data(), mSubTopic.size(), "%s/ch%d", mIv->config->name, rec->assign[mPos].ch);
|
||||
|
|
|
@ -1072,6 +1072,8 @@ class RestApi {
|
|||
} else if(F("dev") == jsonIn[F("cmd")]) {
|
||||
DPRINTLN(DBG_INFO, F("dev cmd"));
|
||||
iv->setDevCommand(jsonIn[F("val")].as<int>());
|
||||
} else if(F("restart_ahoy") == jsonIn[F("cmd")]) {
|
||||
mApp->setRebootFlag();
|
||||
} else {
|
||||
jsonOut[F("error")] = F("ERR_UNKNOWN_CMD");
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue