diff --git a/.github/workflows/pre_release.yml b/.github/workflows/pre_release.yml index a7794885f..5e54e3d95 100644 --- a/.github/workflows/pre_release.yml +++ b/.github/workflows/pre_release.yml @@ -36,6 +36,7 @@ jobs: cd interface npm ci npx typesafe-i18n --no-watch + sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts npm run build - name: Build firmware diff --git a/interface/.typesafe-i18n.json b/interface/.typesafe-i18n.json index 4fb6ee852..29ebade77 100644 --- a/interface/.typesafe-i18n.json +++ b/interface/.typesafe-i18n.json @@ -1,5 +1,5 @@ { "adapter": "react", "baseLocale": "pl", - "$schema": "https://unpkg.com/typesafe-i18n@5.16.3/schema/typesafe-i18n.json" + "$schema": "https://unpkg.com/typesafe-i18n@5.17.0/schema/typesafe-i18n.json" } \ No newline at end of file diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index c5f8aa953..2e949f2e8 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -1,8 +1,8 @@ -import type { BaseTranslation } from '../i18n-types'; +import type { Translation } from '../i18n-types'; /* prettier-ignore */ /* eslint-disable */ -const en: BaseTranslation = { +const en: Translation = { LANGUAGE: 'Language', RETRY: 'Retry', LOADING: 'Loading', diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts index 582d790f7..413d21c66 100644 --- a/interface/src/i18n/pl/index.ts +++ b/interface/src/i18n/pl/index.ts @@ -1,8 +1,8 @@ -import type { Translation } from '../i18n-types'; +import type { BaseTranslation } from '../i18n-types'; /* prettier-ignore */ /* eslint-disable */ -const pl: Translation = { +const pl: BaseTranslation = { LANGUAGE: 'Język', RETRY: 'Ponów', LOADING: 'Ładowanie', diff --git a/interface/src/project/DashboardData.tsx b/interface/src/project/DashboardData.tsx index 1ab2d86e7..070f9ba38 100644 --- a/interface/src/project/DashboardData.tsx +++ b/interface/src/project/DashboardData.tsx @@ -1123,7 +1123,7 @@ const DashboardData: FC = () => { type="number" variant="outlined" onChange={updateValue(setAnalog)} - inputProps={{ min: '0', step: '1' }} + inputProps={{ step: '0.001' }} /> )} @@ -1136,7 +1136,7 @@ const DashboardData: FC = () => { type="number" variant="outlined" onChange={updateValue(setAnalog)} - inputProps={{ min: '-100', max: '100', step: '0.1' }} + inputProps={{ step: '0.001' }} /> diff --git a/lib/framework/NetworkStatus.cpp b/lib/framework/NetworkStatus.cpp index 51f6d8647..8a999c46e 100644 --- a/lib/framework/NetworkStatus.cpp +++ b/lib/framework/NetworkStatus.cpp @@ -24,8 +24,23 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) { root["status"] = (uint8_t)wifi_status; } - // for Wifi - if (wifi_status == WL_CONNECTED) { + // for both connections show ethernet + if (ethernet_connected) { + // Ethernet + root["local_ip"] = ETH.localIP().toString(); + root["local_ipv6"] = ETH.localIPv6().toString(); + root["mac_address"] = ETH.macAddress(); + root["subnet_mask"] = ETH.subnetMask().toString(); + root["gateway_ip"] = ETH.gatewayIP().toString(); + IPAddress dnsIP1 = ETH.dnsIP(0); + IPAddress dnsIP2 = ETH.dnsIP(1); + if (IPUtils::isSet(dnsIP1)) { + root["dns_ip_1"] = dnsIP1.toString(); + } + if (IPUtils::isSet(dnsIP2)) { + root["dns_ip_2"] = dnsIP2.toString(); + } + } else if (wifi_status == WL_CONNECTED) { root["local_ip"] = WiFi.localIP().toString(); root["local_ipv6"] = WiFi.localIPv6().toString(); root["mac_address"] = WiFi.macAddress(); @@ -47,21 +62,6 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) { if (dnsIP2 != INADDR_NONE) { root["dns_ip_2"] = dnsIP2.toString(); } - } else if (ethernet_connected) { - // Ethernet - root["local_ip"] = ETH.localIP().toString(); - root["local_ipv6"] = ETH.localIPv6().toString(); - root["mac_address"] = ETH.macAddress(); - root["subnet_mask"] = ETH.subnetMask().toString(); - root["gateway_ip"] = ETH.gatewayIP().toString(); - IPAddress dnsIP1 = ETH.dnsIP(0); - IPAddress dnsIP2 = ETH.dnsIP(1); - if (IPUtils::isSet(dnsIP1)) { - root["dns_ip_1"] = dnsIP1.toString(); - } - if (IPUtils::isSet(dnsIP2)) { - root["dns_ip_2"] = dnsIP2.toString(); - } } response->setLength(); diff --git a/scripts/build_interface.py b/scripts/build_interface.py index e4a5fc0f9..6da3e54ec 100644 --- a/scripts/build_interface.py +++ b/scripts/build_interface.py @@ -24,6 +24,10 @@ def buildWeb(): try: env.Execute("npm install") env.Execute("npx typesafe-i18n --no-watch") + with open("./src/i18n/i18n-util.ts") as r: + text = r.read().replace("Locales = 'pl'", "Locales = 'en'") + with open("./src/i18n/i18n-util.ts", "w") as w: + w.write(text) env.Execute("npm run build") buildPath = Path("build") wwwPath = Path("../data/www") diff --git a/src/device_library.h b/src/device_library.h index 21be1692d..288e04dbb 100644 --- a/src/device_library.h +++ b/src/device_library.h @@ -39,9 +39,9 @@ {167, DeviceType::BOILER, "Cerapur Aero", DeviceFlags::EMS_DEVICE_FLAG_NONE}, {168, DeviceType::BOILER, "Hybrid Heatpump", DeviceFlags::EMS_DEVICE_FLAG_HYBRID}, {170, DeviceType::BOILER, "Logano GB212", DeviceFlags::EMS_DEVICE_FLAG_NONE}, -{172, DeviceType::BOILER, "Enviline/Compress 6000AW/Hybrid 7000iAW/SupraEco/Geo 5xx", DeviceFlags::EMS_DEVICE_FLAG_HEATPUMP}, +{172, DeviceType::BOILER, "Enviline/Compress 6000AW/Hybrid 7000iAW/SupraEco/Geo 5xx/WLW196i", DeviceFlags::EMS_DEVICE_FLAG_HEATPUMP}, {173, DeviceType::BOILER, "Geo 5xx", DeviceFlags::EMS_DEVICE_FLAG_HEATPUMP}, -{195, DeviceType::BOILER, "Condens 5000i/Greenstar 8000", DeviceFlags::EMS_DEVICE_FLAG_NONE}, +{195, DeviceType::BOILER, "Condens 5000i/Greenstar 8000/GC9800IW", DeviceFlags::EMS_DEVICE_FLAG_NONE}, {203, DeviceType::BOILER, "Logamax U122/Cerapur", DeviceFlags::EMS_DEVICE_FLAG_NONE}, {206, DeviceType::BOILER, "Ecomline Excellent", DeviceFlags::EMS_DEVICE_FLAG_NONE}, {208, DeviceType::BOILER, "Logamax Plus/GB192/Condens GC9000/Greenstar ErP", DeviceFlags::EMS_DEVICE_FLAG_NONE}, diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index dd000c709..12bce02dc 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -2251,7 +2251,11 @@ bool Thermostat::set_mode(const char * value, const int8_t id) { } else { // check for the mode being a full string name if (!Helpers::value2enum(value, enum_index, mode_list)) { - return false; // not found + mode_list = FL_(enum_mode_ha); + if (Mqtt::ha_enabled() && !Helpers::value2enum(value, enum_index, mode_list)) { + LOG_WARNING("wrong mode: %s", value); + return false; // not found + } } } diff --git a/src/locale_common.h b/src/locale_common.h index 419fb3d2a..fdc4b59fa 100644 --- a/src/locale_common.h +++ b/src/locale_common.h @@ -278,6 +278,7 @@ MAKE_PSTR_ENUM(enum_mode3, FL_(night), FL_(day), FL_(auto)) // RC35 MAKE_PSTR_ENUM(enum_mode4, FL_(nofrost), FL_(eco), FL_(heat), FL_(auto)) // JUNKERS MAKE_PSTR_ENUM(enum_mode5, FL_(auto), FL_(off)) // CRF MAKE_PSTR_ENUM(enum_mode6, FL_(nofrost), FL_(night), FL_(day)) // RC10 +MAKE_PSTR_ENUM(enum_mode_ha, FL_(off), FL_(heat), FL_(auto)) // HA climate MAKE_PSTR_ENUM(enum_modetype, FL_(eco), FL_(comfort)) MAKE_PSTR_ENUM(enum_modetype3, FL_(night), FL_(day)) diff --git a/src/system.cpp b/src/system.cpp index 6b857b4a8..22ffa0068 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -541,7 +541,17 @@ void System::send_info_mqtt(const char * event_str) { doc["event"] = event_str; doc["version"] = EMSESP_APP_VERSION; #ifndef EMSESP_STANDALONE - if (WiFi.status() == WL_CONNECTED) { + 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()); + } + } else if (WiFi.status() == WL_CONNECTED) { doc["connection"] = "wifi"; doc["hostname"] = WiFi.getHostname(); doc["SSID"] = WiFi.SSID(); @@ -554,16 +564,6 @@ void System::send_info_mqtt(const char * event_str) { 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(), true); // topic called "info" and it's Retained @@ -1061,15 +1061,26 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp node["uptime"] = uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3); // node["uptime (seconds)"] = uuid::get_uptime_sec(); #ifndef EMSESP_STANDALONE - node["freemem"] = ESP.getFreeHeap() / 1024; // kilobytes - node["free_app"] = EMSESP::system_.appFree(); // kilobytes + node["freemem"] = ESP.getFreeHeap() / 1024; // kilobytes + node["maxalloc"] = ESP.getMaxAllocHeap() / 1024; // kilobytes + node["free_app"] = EMSESP::system_.appFree(); // kilobytes #endif node["reset reason"] = EMSESP::system_.reset_reason(0) + " / " + EMSESP::system_.reset_reason(1); #ifndef EMSESP_STANDALONE // Network Status node = output.createNestedObject("Network Info"); - if (WiFi.status() == WL_CONNECTED) { + if (EMSESP::system_.ethernet_connected()) { + node["connection"] = "Ethernet"; + node["hostname"] = ETH.getHostname(); + node["MAC"] = ETH.macAddress(); + node["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask()); + node["IPv4 gateway"] = uuid::printable_to_string(ETH.gatewayIP()); + node["IPv4 nameserver"] = uuid::printable_to_string(ETH.dnsIP()); + if (ETH.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") { + node["IPv6 address"] = uuid::printable_to_string(ETH.localIPv6()); + } + } else if (WiFi.status() == WL_CONNECTED) { node["connection"] = "WiFi"; node["hostname"] = WiFi.getHostname(); // node["SSID"] = WiFi.SSID(); @@ -1082,22 +1093,6 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp if (WiFi.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") { node["IPv6 address"] = uuid::printable_to_string(WiFi.localIPv6()); } - } else if (EMSESP::system_.ethernet_connected()) { - node["connection"] = "Ethernet"; - node["hostname"] = ETH.getHostname(); - node["MAC"] = ETH.macAddress(); - node["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask()); - node["IPv4 gateway"] = uuid::printable_to_string(ETH.gatewayIP()); - node["IPv4 nameserver"] = uuid::printable_to_string(ETH.dnsIP()); - if (ETH.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") { - node["IPv6 address"] = uuid::printable_to_string(ETH.localIPv6()); - } - EMSESP::webSettingsService.read([&](WebSettings & settings) { - node["phy type"] = settings.phy_type; - node["eth power"] = settings.eth_power; - node["eth phy addr"] = settings.eth_phy_addr; - node["eth clock mode"] = settings.eth_clock_mode; - }); } #endif EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & settings) { @@ -1236,11 +1231,19 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp node["shower alert coldshot"] = settings.shower_alert_coldshot; // seconds node["shower alert trigger"] = settings.shower_alert_trigger; // minutes } - node["rx gpio"] = settings.rx_gpio; - node["tx gpio"] = settings.tx_gpio; - node["dallas gpio"] = settings.dallas_gpio; - node["pbutton gpio"] = settings.pbutton_gpio; - node["led gpio"] = settings.led_gpio; + if (settings.board_profile == "CUSTOM") { + node["phy type"] = settings.phy_type; + if (settings.phy_type != PHY_type::PHY_TYPE_NONE) { + node["eth power"] = settings.eth_power; + node["eth phy_addr"] = settings.eth_phy_addr; + node["eth clock_mode"] = settings.eth_clock_mode; + } + node["rx gpio"] = settings.rx_gpio; + node["tx gpio"] = settings.tx_gpio; + node["dallas gpio"] = settings.dallas_gpio; + node["pbutton gpio"] = settings.pbutton_gpio; + node["led gpio"] = settings.led_gpio; + } node["hide led"] = settings.hide_led; node["notoken api"] = settings.notoken_api; node["readonly mode"] = settings.readonly_mode;