diff --git a/src/plugins/zeroExport/powermeter.h b/src/plugins/zeroExport/powermeter.h index eca8ec59..eb0e6253 100644 --- a/src/plugins/zeroExport/powermeter.h +++ b/src/plugins/zeroExport/powermeter.h @@ -46,7 +46,8 @@ class powermeter { * @param *log * @returns void */ - bool setup(zeroExport_t *cfg, PubMqttType *mqtt, JsonObject *log) { + bool setup(IApp *app, zeroExport_t *cfg, PubMqttType *mqtt, JsonObject *log) { + mApp = app; mCfg = cfg; mMqtt = mqtt; mLog = log; @@ -277,6 +278,7 @@ class powermeter { zeroExport_t *mCfg; PubMqttType *mMqtt = nullptr; JsonObject *mLog; + IApp *mApp = nullptr; unsigned long mPreviousTsp = millis(); @@ -291,8 +293,9 @@ class powermeter { */ void setHeader(HTTPClient *h) { h->setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS); - h->setUserAgent("Ahoy-Agent"); - // TODO: Ahoy-0.8.850024-zero +/// h->setUserAgent("Ahoy-Agent"); +/// // TODO: Ahoy-0.8.850024-zero + h->setUserAgent(mApp->getVersion()); h->setConnectTimeout(500); h->setTimeout(1000); h->addHeader("Content-Type", "application/json"); diff --git a/src/plugins/zeroExport/zeroExport.h b/src/plugins/zeroExport/zeroExport.h index 2b5aac9b..58541623 100644 --- a/src/plugins/zeroExport/zeroExport.h +++ b/src/plugins/zeroExport/zeroExport.h @@ -47,7 +47,7 @@ class ZeroExport { mApi = api; mMqtt = mqtt; - mIsInitialized = mPowermeter.setup(mCfg, mqtt, &mLog); + mIsInitialized = mPowermeter.setup(mApp, mCfg, mqtt, &mLog); } /** loop @@ -106,7 +106,7 @@ class ZeroExport { return; } - + uint16_t groupPower = 0; uint16_t groupLimit = 0; for (uint8_t inv = 0; inv < ZEROEXPORT_GROUP_MAX_INVERTERS; inv++) {