Merge pull request #741 from proddy/dev

minor updates, also implements #707
This commit is contained in:
Proddy
2022-11-10 16:12:21 -05:00
committed by GitHub
15 changed files with 113 additions and 115 deletions

View File

@@ -1,5 +1,5 @@
{
"adapter": "react",
"baseLocale": "pl",
"$schema": "https://unpkg.com/typesafe-i18n@5.16.2/schema/typesafe-i18n.json"
"adapter": "react",
"baseLocale": "pl",
"$schema": "https://unpkg.com/typesafe-i18n@5.16.3/schema/typesafe-i18n.json"
}

View File

@@ -12,7 +12,7 @@
"@emotion/styled": "^11.10.5",
"@msgpack/msgpack": "^2.8.0",
"@mui/icons-material": "^5.10.9",
"@mui/material": "^5.10.12",
"@mui/material": "^5.10.13",
"@table-library/react-table-library": "4.0.23",
"@types/lodash": "^4.14.188",
"@types/node": "^18.11.9",
@@ -34,7 +34,7 @@
"react-router-dom": "^6.4.3",
"react-scripts": "5.0.1",
"sockette": "^2.0.6",
"typesafe-i18n": "^5.16.2",
"typesafe-i18n": "^5.16.3",
"typescript": "^4.8.4"
},
"devDependencies": {
@@ -3091,9 +3091,9 @@
}
},
"node_modules/@mui/base": {
"version": "5.0.0-alpha.104",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.104.tgz",
"integrity": "sha512-tQPxZTzfYMwxYfKhEwufbTfdLpNjFdW7bXq6dK0j8651AAyZL4M8wynWUQ98hH1362R26mZFhVxHB2UD9t7VuA==",
"version": "5.0.0-alpha.105",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.105.tgz",
"integrity": "sha512-4IPBcJQIgVVXQvN6DQMoCHed52GBtwSqYs0jD0dDcMR3o76AodQtpEeWFz3p7mJoc6f/IHBl9U6jEfL1r/kM4g==",
"dependencies": {
"@babel/runtime": "^7.19.0",
"@emotion/is-prop-valid": "^1.2.0",
@@ -3123,9 +3123,9 @@
}
},
"node_modules/@mui/core-downloads-tracker": {
"version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.12.tgz",
"integrity": "sha512-cR8lOS606G++iVHR8I6ySgMAEiPoA3DxO/nLeqiv7w7d1707kvKoV4/7SWjh4ui+kHb052xlf/G196q2EKx31w==",
"version": "5.10.13",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.13.tgz",
"integrity": "sha512-zWkWPV/SaNdsIdxAWiuVGZ+Ue3BkfSIlU/BFIrJmuUcwiIa7gQsbI/DOpj1KzLvqZhdEe2wC1aG4nCHfzgc1Hg==",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/mui"
@@ -3157,14 +3157,14 @@
}
},
"node_modules/@mui/material": {
"version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.10.12.tgz",
"integrity": "sha512-rG9ZTkG9qUwujyAY1I+uQAa9pkGdsWY3KN+wvS/6H6ZbYIA06QRwmig6ySC6LbeB3WL/I/1ngwJqWX7nfINSbA==",
"version": "5.10.13",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.10.13.tgz",
"integrity": "sha512-TkkT1rNc0/hhL4/+zv4gYcA6egNWBH/1Tz+azoTnQIUdZ32fgwFI2pFX2KVJNTt30xnLznxDWtTv7ilmJQ52xw==",
"dependencies": {
"@babel/runtime": "^7.19.0",
"@mui/base": "5.0.0-alpha.104",
"@mui/core-downloads-tracker": "^5.10.12",
"@mui/system": "^5.10.12",
"@mui/base": "5.0.0-alpha.105",
"@mui/core-downloads-tracker": "^5.10.13",
"@mui/system": "^5.10.13",
"@mui/types": "^7.2.0",
"@mui/utils": "^5.10.9",
"@types/react-transition-group": "^4.4.5",
@@ -3258,9 +3258,9 @@
}
},
"node_modules/@mui/system": {
"version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.12.tgz",
"integrity": "sha512-9DcN3hF2KTTTpZ0K5Tn20B+Tz7tIqDmJLk1M6P0CYoAGUN/xrcF/6dn1zZ829rxE5tmauoDUekTfomrvPsvlSQ==",
"version": "5.10.13",
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.13.tgz",
"integrity": "sha512-Xzx26Asu5fVlm0ucm+gnJmeX4Y1isrpVDvqxX4yJaOT7Fzmd8Lfq9ih3QMfZajns5LMtUiOuCQlVFRtUG5IY7A==",
"dependencies": {
"@babel/runtime": "^7.19.0",
"@mui/private-theming": "^5.10.9",
@@ -16398,9 +16398,9 @@
}
},
"node_modules/typesafe-i18n": {
"version": "5.16.2",
"resolved": "https://registry.npmjs.org/typesafe-i18n/-/typesafe-i18n-5.16.2.tgz",
"integrity": "sha512-s1eVQUhq7e0nbVm5Ntb3fLmA1UNi3yEUZN0VCPGGAzVAyS2IUdtDP1J9DINGgbFmBUkHwEAZ6DPSRl9Ca1cPaA==",
"version": "5.16.3",
"resolved": "https://registry.npmjs.org/typesafe-i18n/-/typesafe-i18n-5.16.3.tgz",
"integrity": "sha512-9KxHDFzNW5vA1a4kVPEm9Jslch0H5W2IkPcJjuaqofr86U0EXkrkvF3IbPjzwnWwEf/wC900ZE7RPnePW5KYKg==",
"bin": {
"typesafe-i18n": "cli/typesafe-i18n.mjs"
},
@@ -19614,9 +19614,9 @@
"integrity": "sha512-h9u4u/jiIRKbq25PM+zymTyW6bhTzELvOoUd+AvYriWOAKpLGnIamaET3pnHYoI5iYphAHBI4ayx0MehR+VVPQ=="
},
"@mui/base": {
"version": "5.0.0-alpha.104",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.104.tgz",
"integrity": "sha512-tQPxZTzfYMwxYfKhEwufbTfdLpNjFdW7bXq6dK0j8651AAyZL4M8wynWUQ98hH1362R26mZFhVxHB2UD9t7VuA==",
"version": "5.0.0-alpha.105",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.105.tgz",
"integrity": "sha512-4IPBcJQIgVVXQvN6DQMoCHed52GBtwSqYs0jD0dDcMR3o76AodQtpEeWFz3p7mJoc6f/IHBl9U6jEfL1r/kM4g==",
"requires": {
"@babel/runtime": "^7.19.0",
"@emotion/is-prop-valid": "^1.2.0",
@@ -19629,9 +19629,9 @@
}
},
"@mui/core-downloads-tracker": {
"version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.12.tgz",
"integrity": "sha512-cR8lOS606G++iVHR8I6ySgMAEiPoA3DxO/nLeqiv7w7d1707kvKoV4/7SWjh4ui+kHb052xlf/G196q2EKx31w=="
"version": "5.10.13",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.13.tgz",
"integrity": "sha512-zWkWPV/SaNdsIdxAWiuVGZ+Ue3BkfSIlU/BFIrJmuUcwiIa7gQsbI/DOpj1KzLvqZhdEe2wC1aG4nCHfzgc1Hg=="
},
"@mui/icons-material": {
"version": "5.10.9",
@@ -19642,14 +19642,14 @@
}
},
"@mui/material": {
"version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.10.12.tgz",
"integrity": "sha512-rG9ZTkG9qUwujyAY1I+uQAa9pkGdsWY3KN+wvS/6H6ZbYIA06QRwmig6ySC6LbeB3WL/I/1ngwJqWX7nfINSbA==",
"version": "5.10.13",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.10.13.tgz",
"integrity": "sha512-TkkT1rNc0/hhL4/+zv4gYcA6egNWBH/1Tz+azoTnQIUdZ32fgwFI2pFX2KVJNTt30xnLznxDWtTv7ilmJQ52xw==",
"requires": {
"@babel/runtime": "^7.19.0",
"@mui/base": "5.0.0-alpha.104",
"@mui/core-downloads-tracker": "^5.10.12",
"@mui/system": "^5.10.12",
"@mui/base": "5.0.0-alpha.105",
"@mui/core-downloads-tracker": "^5.10.13",
"@mui/system": "^5.10.13",
"@mui/types": "^7.2.0",
"@mui/utils": "^5.10.9",
"@types/react-transition-group": "^4.4.5",
@@ -19682,9 +19682,9 @@
}
},
"@mui/system": {
"version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.12.tgz",
"integrity": "sha512-9DcN3hF2KTTTpZ0K5Tn20B+Tz7tIqDmJLk1M6P0CYoAGUN/xrcF/6dn1zZ829rxE5tmauoDUekTfomrvPsvlSQ==",
"version": "5.10.13",
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.13.tgz",
"integrity": "sha512-Xzx26Asu5fVlm0ucm+gnJmeX4Y1isrpVDvqxX4yJaOT7Fzmd8Lfq9ih3QMfZajns5LMtUiOuCQlVFRtUG5IY7A==",
"requires": {
"@babel/runtime": "^7.19.0",
"@mui/private-theming": "^5.10.9",
@@ -29064,9 +29064,9 @@
}
},
"typesafe-i18n": {
"version": "5.16.2",
"resolved": "https://registry.npmjs.org/typesafe-i18n/-/typesafe-i18n-5.16.2.tgz",
"integrity": "sha512-s1eVQUhq7e0nbVm5Ntb3fLmA1UNi3yEUZN0VCPGGAzVAyS2IUdtDP1J9DINGgbFmBUkHwEAZ6DPSRl9Ca1cPaA==",
"version": "5.16.3",
"resolved": "https://registry.npmjs.org/typesafe-i18n/-/typesafe-i18n-5.16.3.tgz",
"integrity": "sha512-9KxHDFzNW5vA1a4kVPEm9Jslch0H5W2IkPcJjuaqofr86U0EXkrkvF3IbPjzwnWwEf/wC900ZE7RPnePW5KYKg==",
"requires": {}
},
"typescript": {

View File

@@ -8,7 +8,7 @@
"@emotion/styled": "^11.10.5",
"@msgpack/msgpack": "^2.8.0",
"@mui/icons-material": "^5.10.9",
"@mui/material": "^5.10.12",
"@mui/material": "^5.10.13",
"@table-library/react-table-library": "4.0.23",
"@types/lodash": "^4.14.188",
"@types/node": "^18.11.9",
@@ -30,7 +30,7 @@
"react-router-dom": "^6.4.3",
"react-scripts": "5.0.1",
"sockette": "^2.0.6",
"typesafe-i18n": "^5.16.2",
"typesafe-i18n": "^5.16.3",
"typescript": "^4.8.4"
},
"scripts": {

View File

@@ -98,10 +98,10 @@ const en: BaseTranslation = {
NUM_DEVICES: '{num} Device{{s}}',
NUM_TEMP_SENSORS: '{num} Temperature Sensor{{s}}',
NUM_ANALOG_SENSORS: '{num} Analog Sensor{{s}}',
NUM_DAYS: '{num} Day{{s}}',
NUM_SECONDS: '{num} Second{{s}}',
NUM_HOURS: '{num} Hour{{s}}',
NUM_MINUTES: '{num} Minute{{s}}',
NUM_DAYS: '{num} day{{s}}',
NUM_SECONDS: '{num} second{{s}}',
NUM_HOURS: '{num} hour{{s}}',
NUM_MINUTES: '{num} minute{{s}}',
APPLICATION_SETTINGS: 'Application Settings',
CUSTOMIZATION: 'Customization',
APPLICATION_RESTARTING: 'EMS-ESP is restarting',

View File

@@ -98,10 +98,10 @@ const nl: Translation = {
NUM_DEVICES: '{num} Apparaat{{en}}',
NUM_TEMP_SENSORS: '{num} Temperatuursensor{{en}}',
NUM_ANALOG_SENSORS: '{num} Analoge sensor{{en}}',
NUM_DAYS: '{num} Dag{{en}}',
NUM_SECONDS: '{num} Second{{en}}',
NUM_HOURS: '{num} Uur{{en}}',
NUM_MINUTES: '{num} Minuut{{en}}',
NUM_DAYS: '{num} dag{{en}}',
NUM_SECONDS: '{num} second{{en}}',
NUM_HOURS: '{num} uur{{en}}',
NUM_MINUTES: '{num} minuut{{en}}',
APPLICATION_SETTINGS: 'Applicatieinstellingen',
CUSTOMIZATION: 'Custom aanpassingen',
APPLICATION_RESTARTING: 'EMS-ESP herstarten',

View File

@@ -98,10 +98,10 @@ const no: Translation = {
NUM_DEVICES: '{num} Enhet{{er}}',
NUM_TEMP_SENSORS: '{num} Temperatursensor{{er}}',
NUM_ANALOG_SENSORS: '{num} Analogsensor{{er}}',
NUM_DAYS: '{num} Dag{{er}}',
NUM_SECONDS: '{num} Sekund{{er}}',
NUM_HOURS: '{num} Time{{r}}',
NUM_MINUTES: '{num} Minutt{{er}}',
NUM_DAYS: '{num} sag{{er}}',
NUM_SECONDS: '{num} sekund{{er}}',
NUM_HOURS: '{num} time{{r}}',
NUM_MINUTES: '{num} minutt{{er}}',
APPLICATION_SETTINGS: 'Innstillinger',
CUSTOMIZATION: 'Tilpasninger',
APPLICATION_RESTARTING: 'EMS-ESP restarter',

View File

@@ -98,10 +98,10 @@ const se: Translation = {
NUM_DEVICES: '{num} Enhet{{er}}',
NUM_TEMP_SENSORS: '{num} Temperatur-sensor{{er}}',
NUM_ANALOG_SENSORS: '{num} Analoga Sensor{{er}}',
NUM_DAYS: '{num} Dag{{ar}}',
NUM_SECONDS: '{num} Sekund{{er}}',
NUM_HOURS: '{num} Timmar',
NUM_MINUTES: '{num} Minut{{er}}',
NUM_DAYS: '{num} dag{{ar}}',
NUM_SECONDS: '{num} sekund{{er}}',
NUM_HOURS: '{num} timmar',
NUM_MINUTES: '{num} minut{{er}}',
APPLICATION_SETTINGS: 'Inställningar',
CUSTOMIZATION: 'Anpassa',
APPLICATION_RESTARTING: 'EMS-ESP startar om',

View File

@@ -113,7 +113,6 @@ void MqttSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
if (_state.enabled) {
// emsesp::EMSESP::logger().info("Network connection dropped, stopping MQTT client");
_mqttClient.disconnect();
// onConfigUpdated();
}
break;

View File

@@ -14,7 +14,7 @@
"express": "^4.18.2",
"express-sse": "^0.5.3",
"nodemon": "^2.0.20",
"ws": "^8.10.0"
"ws": "^8.11.0"
}
},
"node_modules/@msgpack/msgpack": {
@@ -1015,9 +1015,9 @@
}
},
"node_modules/ws": {
"version": "8.10.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz",
"integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==",
"version": "8.11.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
"engines": {
"node": ">=10.0.0"
},
@@ -1765,9 +1765,9 @@
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="
},
"ws": {
"version": "8.10.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz",
"integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==",
"version": "8.11.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
"requires": {}
}
}

View File

@@ -16,6 +16,6 @@
"express": "^4.18.2",
"express-sse": "^0.5.3",
"nodemon": "^2.0.20",
"ws": "^8.10.0"
"ws": "^8.11.0"
}
}

View File

@@ -260,8 +260,8 @@ char * Helpers::render_value(char * result, const float value, const int8_t form
result++;
}
*result++ = '.';
int32_t decimal = abs((int32_t)((value - whole) * p[format]));
*result++ = '.';
auto decimal = abs((int32_t)((value - whole) * p[format]));
for (int8_t i = 1; i < format; i++) {
if (decimal < p[i]) {
*result++ = '0'; // add leading zeros

View File

@@ -537,57 +537,18 @@ bool Mqtt::get_publish_onchange(uint8_t device_type) {
}
// MQTT onConnect - when an MQTT connect is established
// send out some inital MQTT messages
void Mqtt::on_connect() {
if (connecting_) { // prevent duplicated connections
return;
if (connecting_) {
return; // prevent duplicated connections
}
LOG_INFO("MQTT connected");
connecting_ = true;
connectcount_++;
connectcount_++; // count # reconnects. not currently used.
load_settings(); // reload MQTT settings - in case they have changes
// send info topic appended with the version information as JSON
StaticJsonDocument<EMSESP_JSON_SIZE_MEDIUM> doc;
// first time to connect
if (connectcount_ == 1) {
doc["event"] = "start";
} else {
doc["event"] = "reconnect";
}
doc["version"] = EMSESP_APP_VERSION;
#ifndef EMSESP_STANDALONE
if (WiFi.status() == WL_CONNECTED) {
doc["connection"] = "WiFi";
doc["hostname"] = WiFi.getHostname();
doc["SSID"] = WiFi.SSID();
doc["BSSID"] = WiFi.BSSIDstr();
doc["RSSI"] = WiFi.RSSI();
doc["MAC"] = WiFi.macAddress();
doc["IPv4 address"] = uuid::printable_to_string(WiFi.localIP()) + "/" + uuid::printable_to_string(WiFi.subnetMask());
doc["IPv4 gateway"] = uuid::printable_to_string(WiFi.gatewayIP());
doc["IPv4 nameserver"] = uuid::printable_to_string(WiFi.dnsIP());
if (WiFi.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") {
doc["IPv6 address"] = uuid::printable_to_string(WiFi.localIPv6());
}
} else if (EMSESP::system_.ethernet_connected()) {
doc["connection"] = "Ethernet";
doc["hostname"] = ETH.getHostname();
doc["MAC"] = ETH.macAddress();
doc["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask());
doc["IPv4 gateway"] = uuid::printable_to_string(ETH.gatewayIP());
doc["IPv4 nameserver"] = uuid::printable_to_string(ETH.dnsIP());
if (ETH.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") {
doc["IPv6 address"] = uuid::printable_to_string(ETH.localIPv6());
}
}
#endif
publish(F_(info), doc.as<JsonObject>()); // topic called "info"
if (ha_enabled_) {
queue_unsubscribe_message(discovery_prefix_ + "/+/" + mqtt_basename_ + "/#");
EMSESP::reset_mqtt_ha(); // re-create all HA devices if there are any
@@ -595,7 +556,8 @@ void Mqtt::on_connect() {
ha_climate_reset(true);
} else {
// with disabled HA we subscribe and the broker sends all stored HA-emsesp-configs.
// In line 272 they are removed. If HA is enabled the subscriptions are removed.
// Around line 272 they are removed (search for "// remove HA topics if we don't use discover")
// If HA is enabled the subscriptions are removed.
// As described in the doc (https://emsesp.github.io/docs/#/Troubleshooting?id=home-assistant):
// disable HA, wait 5 minutes (to allow the broker to send all), than reenable HA again.
queue_subscribe_message(discovery_prefix_ + "/+/" + mqtt_basename_ + "/#");

View File

@@ -535,6 +535,40 @@ void System::loop() {
#endif
}
// send MQTT info topic appended with the version information as JSON, as a retained flag
void System::send_info_mqtt(const char * event_str) {
StaticJsonDocument<EMSESP_JSON_SIZE_MEDIUM> doc;
doc["event"] = event_str;
doc["version"] = EMSESP_APP_VERSION;
#ifndef EMSESP_STANDALONE
if (WiFi.status() == WL_CONNECTED) {
doc["connection"] = "wifi";
doc["hostname"] = WiFi.getHostname();
doc["SSID"] = WiFi.SSID();
doc["BSSID"] = WiFi.BSSIDstr();
doc["RSSI"] = WiFi.RSSI();
doc["MAC"] = WiFi.macAddress();
doc["IPv4 address"] = uuid::printable_to_string(WiFi.localIP()) + "/" + uuid::printable_to_string(WiFi.subnetMask());
doc["IPv4 gateway"] = uuid::printable_to_string(WiFi.gatewayIP());
doc["IPv4 nameserver"] = uuid::printable_to_string(WiFi.dnsIP());
if (WiFi.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") {
doc["IPv6 address"] = uuid::printable_to_string(WiFi.localIPv6());
}
} else if (EMSESP::system_.ethernet_connected()) {
doc["connection"] = "ethernet";
doc["hostname"] = ETH.getHostname();
doc["MAC"] = ETH.macAddress();
doc["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask());
doc["IPv4 gateway"] = uuid::printable_to_string(ETH.gatewayIP());
doc["IPv4 nameserver"] = uuid::printable_to_string(ETH.dnsIP());
if (ETH.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") {
doc["IPv6 address"] = uuid::printable_to_string(ETH.localIPv6());
}
}
#endif
Mqtt::publish_retain(F_(info), doc.as<JsonObject>(), true); // topic called "info" and it's Retained
}
// create the json for heartbeat
bool System::heartbeat_json(JsonObject & output) {
uint8_t bus_status = EMSESP::bus_status();

View File

@@ -77,6 +77,7 @@ class System {
bool check_upgrade();
bool heartbeat_json(JsonObject & output);
void send_heartbeat();
void send_info_mqtt(const char * event_str);
bool syslog_enabled() {
return syslog_enabled_;

View File

@@ -44,6 +44,7 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
#endif
EMSESP::system_.syslog_init();
mDNS_start();
EMSESP::system_.send_info_mqtt("connected");
break;
case ARDUINO_EVENT_ETH_START:
@@ -69,6 +70,7 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
EMSESP::system_.syslog_init();
EMSESP::system_.ethernet_connected(true);
mDNS_start();
EMSESP::system_.send_info_mqtt("connected");
}
break;
@@ -106,9 +108,9 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
} else {
EMSESP::logger().info("WiFi connected with IPv6=%s, hostname=%s", WiFi.localIPv6().toString().c_str(), WiFi.getHostname());
}
// EMSESP::system_.send_heartbeat();
EMSESP::system_.syslog_init();
mDNS_start();
EMSESP::system_.send_info_mqtt("connected");
break;
#endif