Skip to content

Commit

Permalink
Merge branch 'geronet1-development03' into development03
Browse files Browse the repository at this point in the history
  • Loading branch information
lumapu committed Jun 9, 2024
2 parents 7336981 + 773d375 commit c998522
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
5 changes: 2 additions & 3 deletions src/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
//-------------------------------------

// Fallback WiFi Info
#define FB_WIFI_SSID "YOUR_WIFI_SSID"
#define FB_WIFI_PWD "YOUR_WIFI_PWD"

#define FB_WIFI_SSID ""
#define FB_WIFI_PWD ""

// Access Point Info
// In case there is no WiFi Network or Ahoy can not connect to it, it will act as an Access Point
Expand Down
3 changes: 0 additions & 3 deletions src/config/config_override_example.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#ifndef __CONFIG_OVERRIDE_H__
#define __CONFIG_OVERRIDE_H__

// override fallback WiFi info
#define FB_WIFI_OVERRIDDEN

// each override must be preceded with an #undef statement
#undef FB_WIFI_SSID
#define FB_WIFI_SSID "MY_SSID"
Expand Down
2 changes: 1 addition & 1 deletion src/network/AhoyWifiEsp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AhoyWifi : public AhoyNetwork {
void begin() override {
mAp.enable();

if(String(FB_WIFI_SSID) == mConfig->sys.stationSsid)
if(strlen(mConfig->sys.stationSsid) == 0)
return; // no station wifi defined

WiFi.disconnect(); // clean up
Expand Down
13 changes: 10 additions & 3 deletions src/publisher/pubMqttIvData.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,20 @@ class PubMqttIvData {
if (!mCfg->json) {
snprintf(mSubTopic.data(), mSubTopic.size(), "%s/ch%d/%s", mIv->config->name, rec->assign[mPos].ch, fields[rec->assign[mPos].fieldId]);
snprintf(mVal.data(), mVal.size(), "%g", ah::round3(mIv->getValue(mPos, rec)));
} else {
if (FLD_ACT_ACTIVE_PWR_LIMIT == rec->assign[mPos].fieldId) {
uint8_t qos = (FLD_ACT_ACTIVE_PWR_LIMIT == rec->assign[mPos].fieldId) ? QOS_2 : QOS_0;
snprintf(mSubTopic.data(), mSubTopic.size(), "%s/%s", mIv->config->name, fields[rec->assign[mPos].fieldId]);
snprintf(mVal.data(), mVal.size(), "%g", ah::round3(mIv->getValue(mPos, rec)));
mPublish(mSubTopic.data(), mVal.data(), retained, qos);
}
}
}

if ((InverterDevInform_All == mCmd) || (InverterDevInform_Simple == mCmd) || !mCfg->json) {
if ((InverterDevInform_All == mCmd) || (InverterDevInform_Simple == mCmd) || !mCfg->json)
{
uint8_t qos = (FLD_ACT_ACTIVE_PWR_LIMIT == rec->assign[mPos].fieldId) ? QOS_2 : QOS_0;
if((FLD_EVT != rec->assign[mPos].fieldId)
&& (FLD_LAST_ALARM_CODE != rec->assign[mPos].fieldId))
if((FLD_EVT != rec->assign[mPos].fieldId) && (FLD_LAST_ALARM_CODE != rec->assign[mPos].fieldId))
mPublish(mSubTopic.data(), mVal.data(), retained, qos);
}
}
Expand Down
18 changes: 13 additions & 5 deletions src/web/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ <h3>{#SUPPORT}:</h3>
var p = div(["none"]);
var total = 0;
var count = 0;
var mobile = window.screen.width < 470;

for(var i of obj) {
var icon = iconSuccess;
var cl = "icon-success";
Expand All @@ -131,7 +133,8 @@ <h3>{#SUPPORT}:</h3>
} else if(0 == i["ts_last_success"]) {
avail = "{#AVAIL_NO_DATA}";
} else {
avail = "{#AVAIL} ";
if (!mobile)
avail = "{#AVAIL} ";
if(false == i["is_producing"])
avail += "{#NOT_PRODUCING}";
else {
Expand All @@ -142,11 +145,16 @@ <h3>{#SUPPORT}:</h3>
}
}

var text;
if (mobile)
text = "#";
else
text = "{#INVERTER} #";
p.append(
svg(icon, 30, 30, "icon " + cl),
span("{#INVERTER} #" + i["id"] + ": " + i["name"] + " {#IS} " + avail),
br()
);
svg(icon, 30, 30, "icon " + cl),
span(text + i["id"] + ": " + i["name"] + " {#IS} " + avail),
br()
);

if(false == i["is_avail"]) {
if(i["ts_last_success"] > 0) {
Expand Down

0 comments on commit c998522

Please sign in to comment.