hooked to LiveView instead of MQTT
This commit is contained in:
parent
5f1664ad6b
commit
d6b8f260fb
@ -10,7 +10,6 @@
|
||||
#include "WebApi_database.h"
|
||||
|
||||
MqttHandleInverterTotalClass MqttHandleInverterTotal;
|
||||
WebApiDatabaseClass database;
|
||||
|
||||
void MqttHandleInverterTotalClass::init()
|
||||
{
|
||||
@ -34,6 +33,5 @@ void MqttHandleInverterTotalClass::loop()
|
||||
|
||||
_lastPublish.set(Configuration.get().Mqtt_PublishInterval * 1000);
|
||||
|
||||
database.write(Datastore.getTotalAcYieldTotalEnabled()); // write value to database
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
#include "defaults.h"
|
||||
#include <AsyncJson.h>
|
||||
|
||||
WebApiDatabaseClass database;
|
||||
|
||||
WebApiWsLiveClass::WebApiWsLiveClass()
|
||||
: _ws("/livedata")
|
||||
{
|
||||
@ -164,6 +166,8 @@ void WebApiWsLiveClass::generateJsonResponse(JsonVariant& root)
|
||||
addTotalField(totalObj, "YieldDay", Datastore.getTotalAcYieldDayEnabled(), "Wh", Datastore.getTotalAcYieldDayDigits());
|
||||
addTotalField(totalObj, "YieldTotal", Datastore.getTotalAcYieldTotalEnabled(), "kWh", Datastore.getTotalAcYieldTotalDigits());
|
||||
|
||||
database.write(Datastore.getTotalAcYieldTotalEnabled()); // write value to database
|
||||
|
||||
JsonObject hintObj = root.createNestedObject("hints");
|
||||
struct tm timeinfo;
|
||||
hintObj["time_sync"] = !getLocalTime(&timeinfo, 5);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user