Merge remote-tracking branch 'emsesp/core3' into core3

This commit is contained in:
MichaelDvP
2026-07-27 08:56:17 +02:00
48 changed files with 6499 additions and 6404 deletions
+4 -2
View File
@@ -9,6 +9,7 @@ For more details go to [emsesp.org](https://emsesp.org/).
- user-requested LED blink [#3063](https://github.com/emsesp/EMS-ESP32/issues/3063)
- KM300 at address 0x4A [#3084](https://github.com/emsesp/EMS-ESP32/issues/3084)
- Commands Service that can be called via MQTT or API or used in the Scheduler Service
- option to disable factory reset [#3150](https://github.com/emsesp/EMS-ESP32/issues/3150)
## Fixed
@@ -20,7 +21,7 @@ For more details go to [emsesp.org](https://emsesp.org/).
- offset of hpminflowtemp [#3144](https://github.com/emsesp/EMS-ESP32/issues/3144)
- water circulation command [#3149](https://github.com/emsesp/EMS-ESP32/pull/3149)
- start scheduler after customEntities, delay scheduler loop after startup, handling of `system/restart` command [#3146](https://github.com/emsesp/EMS-ESP32/issues/3146)
- possible memory leaks fixed.
- possible memory leaks fixed
- repeated startup schedules compute value
- shunting yard show json
@@ -33,4 +34,5 @@ For more details go to [emsesp.org](https://emsesp.org/).
- Dewtemperature for Easycontrol calculated by ems-esp [#3135](https://github.com/emsesp/EMS-ESP32/issues/3135)
- add option for sync thermostat to ntp, allow different time zones [#3148](https://github.com/emsesp/EMS-ESP32/discussions/3148), **defaults to sync**.
- block too many GET requests [mentioned in #3104](https://github.com/emsesp/EMS-ESP32/issues/3104)
- Gateway and Connect devices are not shown in the Devices page [3126](https://github.com/emsesp/EMS-ESP32/discussions/3126)
- Gateway and Connect devices are shown in the Devices page, but disabled [3126](https://github.com/emsesp/EMS-ESP32/discussions/3126)
+1
View File
@@ -134,6 +134,7 @@
"modbus_max_clients": 10,
"modbus_timeout": 300,
"developer_mode": true,
"disable_reset": false,
"email_enabled": true,
"email_security": 2,
"email_server": "smtp.gmail.com",
+6019 -6019
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -112,7 +112,7 @@ telegram_type_id,name,is_fetched
0x02A0,RC300Curves,
0x02A1,RC300Curves,
0x02A2,RC300Curves,
0x02A5,CRFMonitor,
0x02A5,RC300Monitor,
0x02A6,RC300Monitor,
0x02A7,RC300Monitor,
0x02A8,CRFMonitor,
1 telegram_type_id name is_fetched
112 0x02A0 RC300Curves
113 0x02A1 RC300Curves
114 0x02A2 RC300Curves
115 0x02A5 CRFMonitor RC300Monitor
116 0x02A6 RC300Monitor
117 0x02A7 RC300Monitor
118 0x02A8 CRFMonitor
+9 -9
View File
@@ -29,15 +29,15 @@
"@mui/icons-material": "^9.2.0",
"@mui/material": "^9.2.0",
"@table-library/react-table-library": "4.1.15",
"alova": "^3.5.2",
"alova": "^3.5.3",
"etag": "^1.8.1",
"jwt-decode": "^4.0.0",
"mime-types": "^3.0.2",
"preact": "^10.29.7",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"react-icons": "^5.7.0",
"react-router": "^8.2.0",
"react-router": "^8.3.0",
"typesafe-i18n": "^5.27.1",
"typescript": "^6.0.3"
},
@@ -48,15 +48,15 @@
"@types/node": "^26.1.1",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"concurrently": "^10.0.3",
"eslint": "^10.7.0",
"concurrently": "^10.0.4",
"eslint": "^10.8.0",
"eslint-config-prettier": "^10.1.8",
"prettier": "^3.9.5",
"prettier": "^3.9.6",
"rollup-plugin-visualizer": "^7.0.1",
"terser": "^5.49.0",
"typescript-eslint": "^8.64.0",
"typescript-eslint": "^8.65.0",
"vite": "^8.1.5",
"vite-plugin-imagemin": "^0.6.1"
},
"packageManager": "pnpm@11.13.1+sha512.b2fc7683b8a6525414e7d13e1ba28caaddde96bf66ec540bfaeb7e702b81f3e0be4d1f295edf7f9fe0396740a8dce4509c582ddf79891f4543fea32d37645f25"
"packageManager": "pnpm@11.17.0+sha512.cca3cea332ad254bb84145f966d19f4879615210346fc92c79a047f23a0d7b3cca3c3792f0076ba1f1831d277efbcf0a9119b31a9a60eca7fb3d6231f331ef72"
}
+319 -317
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -50,7 +50,7 @@ static constexpr size_t WWW_ASSETS_COUNT = sizeof(WWW_ASSETS) / sizeof(WWW_ASSET
// (e.g. "en,de,nl"). When set, locale chunks outside the list are NOT embedded
// into firmware flash. `en` is always kept as the fallback. Unset => embed all.
const ALL_LOCALES = [
'cz',
'cs',
'de',
'en',
'fr',
+1 -1
View File
@@ -20,7 +20,7 @@ const ALL_LOCALES = [
'sk',
'sv',
'tr',
'cz'
'cs'
] as Locales[];
// Optional build-time allow-list (e.g. VITE_APP_LOCALES="en,de,nl"). When unset,
+2 -1
View File
@@ -489,7 +489,8 @@ const Customizations = () => {
</MenuItem>
{devices.devices.map(
(device: Device) =>
device.id < 90 && (
device.id < 90 &&
device.e !== 0 && (
<MenuItem key={device.id} value={device.id}>
{device.n}&nbsp;({device.tn})
</MenuItem>
+15 -5
View File
@@ -558,16 +558,26 @@ const Devices = memo(() => {
<CircularProgress sx={{ margin: 1 }} size={18} />
)}
{tableList.map((device: Device) => (
<Row key={device.id} item={device}>
<Row key={device.id} item={device} disabled={device.e === 0}>
<Cell>
<DeviceIcon type_id={device.t} />
&nbsp;&nbsp;
{device.n}
<span style={{ color: 'lightblue' }}>
&nbsp;&nbsp;({device.e})
<span style={{ color: device.e === 0 ? 'grey' : 'white' }}>
{device.n}
</span>
{device.e !== 0 && (
<span style={{ color: 'lightblue' }}>
&nbsp;&nbsp;({device.e})
</span>
)}
</Cell>
<Cell stiff>
<ButtonTooltip
title={`DeviceID: 0x${('00' + device.d.toString(16).toUpperCase()).slice(-2)}, ProductID: ${device.p}`}
>
<span>{device.tn}</span>
</ButtonTooltip>
</Cell>
<Cell stiff>{device.tn}</Cell>
</Row>
))}
</Body>
+1
View File
@@ -54,6 +54,7 @@ export interface Settings {
email_recp: string;
email_subject: string;
developer_mode: boolean;
disable_reset: boolean;
}
export enum busConnectionStatus {
@@ -548,7 +548,7 @@ const ApplicationSettings = () => {
margin="normal"
select
>
<MenuItem value="cz">Česky (CZ)</MenuItem>
<MenuItem value="cs">Česky (CS)</MenuItem>
<MenuItem value="de">Deutsch (DE)</MenuItem>
<MenuItem value="en">English (EN)</MenuItem>
<MenuItem value="fr">Français (FR)</MenuItem>
@@ -903,6 +903,16 @@ const ApplicationSettings = () => {
}
label={LL.DEVELOPER_MODE()}
/>
<BlockFormControlLabel
control={
<Checkbox
checked={data.disable_reset}
onChange={updateFormValue}
name="disable_reset"
/>
}
label={LL.DISABLE_RESET()}
/>
<BlockFormControlLabel
control={
<Checkbox
+2 -1
View File
@@ -71,6 +71,7 @@ interface VersionData {
partition: string;
partitions: PartitionData[];
developer_mode: boolean;
disable_reset: boolean;
}
// Memoized components for better performance
@@ -923,7 +924,7 @@ const Version = () => {
>
{LL.RESTART()}
</Button>
{data.developer_mode && (
{!data.disable_reset && (
<Button
startIcon={<SettingsBackupRestoreIcon />}
variant="outlined"
@@ -4,7 +4,7 @@ import type { CSSProperties } from 'react';
import { MenuItem, TextField } from '@mui/material';
import CZflag from 'i18n/CZ.svg';
import CSflag from 'i18n/CS.svg';
import DEflag from 'i18n/DE.svg';
import FRflag from 'i18n/FR.svg';
import GBflag from 'i18n/GB.svg';
@@ -28,7 +28,7 @@ interface LanguageOption {
}
const LANGUAGE_OPTIONS: LanguageOption[] = [
{ key: 'cz', flag: CZflag, label: 'CZ' },
{ key: 'cs', flag: CSflag, label: 'CS' },
{ key: 'de', flag: DEflag, label: 'DE' },
{ key: 'en', flag: GBflag, label: 'EN' },
{ key: 'fr', flag: FRflag, label: 'FR' },

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

@@ -1,6 +1,6 @@
import type { Translation } from '../i18n-types';
const cz: Translation = {
const cs: Translation = {
LANGUAGE: 'Jazyk',
RETRY: 'Zkusit znovu',
LOADING: 'Načítání',
@@ -340,6 +340,7 @@ const cz: Translation = {
AUTO_SCROLL: 'Automatické rolování',
DASHBOARD: 'Dashboard',
DEVELOPER_MODE: 'Režim vývojáře',
DISABLE_RESET: 'Zakázat obnovení továrního nastavení',
BYTES: 'Bajty',
BITMASK: 'Bit Mask',
DUPLICATE: 'Duplikát',
@@ -370,4 +371,4 @@ const cz: Translation = {
EXECUTE_COMMAND_SENT: 'Příkaz odeslán',
};
export default cz;
export default cs;
+1
View File
@@ -340,6 +340,7 @@ const de: Translation = {
AUTO_SCROLL: 'Automatisches Scrollen',
DASHBOARD: 'Dashboard',
DEVELOPER_MODE: 'Entwicklermodus',
DISABLE_RESET: 'Werkseinstellungen deaktivieren',
BYTES: 'Bytes',
BITMASK: 'Bit Maske',
DUPLICATE: 'Kopieren',
+1
View File
@@ -340,6 +340,7 @@ const en: Translation = {
AUTO_SCROLL: 'Auto Scroll',
DASHBOARD: 'Dashboard',
DEVELOPER_MODE: 'Developer Mode',
DISABLE_RESET: 'Disable Factory Reset',
BYTES: 'Bytes',
BITMASK: 'Bit Mask',
DUPLICATE: 'Duplicate',
+1
View File
@@ -340,6 +340,7 @@ const fr: Translation = {
AUTO_SCROLL: 'Défilement automatique',
DASHBOARD: 'Tableau de bord',
DEVELOPER_MODE: 'Mode développeur',
DISABLE_RESET: 'Désactiver la réinitialisation de fabrique',
BYTES: 'Octets',
BITMASK: 'Masque de bits',
DUPLICATE: 'Dupliquer',
+1
View File
@@ -340,6 +340,7 @@ const it: Translation = {
AUTO_SCROLL: 'Scorrimento automatico',
DASHBOARD: 'Pannello di controllo',
DEVELOPER_MODE: 'Modalità sviluppatore',
DISABLE_RESET: 'Disabilita la ripristino di fabbrica',
BYTES: 'Byte',
BITMASK: 'Bitmask',
DUPLICATE: 'Duplicato',
+1
View File
@@ -340,6 +340,7 @@ const nl: Translation = {
AUTO_SCROLL: 'Automatisch Scrollen',
DASHBOARD: 'Dashboard',
DEVELOPER_MODE: 'Ontwikkelaarsmodus',
DISABLE_RESET: 'Fabrieksinstellingen uitschakelen',
BYTES: 'Bytes',
BITMASK: 'Bit Mask',
DUPLICATE: 'Duplicaat',
+1
View File
@@ -340,6 +340,7 @@ const no: Translation = {
AUTO_SCROLL: 'Automatisk rulling',
DASHBOARD: 'Dashboard',
DEVELOPER_MODE: 'Utvikler modus',
DISABLE_RESET: 'Deaktiver fabrikkinnstillinger',
BYTES: 'Bytes',
BITMASK: 'Bitmask',
DUPLICATE: 'Duplikat',
+1
View File
@@ -340,6 +340,7 @@ const pl: BaseTranslation = {
AUTO_SCROLL: 'Auto Scroll',
DASHBOARD: 'Pulpit',
DEVELOPER_MODE: 'Tryb programisty',
DISABLE_RESET: 'Wyłącz reset fabryczny',
BYTES: 'Bajty',
BITMASK: 'Bit Mask',
DUPLICATE: 'Duplicate',
+1
View File
@@ -340,6 +340,7 @@ const sk: Translation = {
AUTO_SCROLL: 'Automatické rolovanie',
DASHBOARD: 'Panel',
DEVELOPER_MODE: 'Režim vývojára',
DISABLE_RESET: 'Zakázať továrenské nastavenia',
BYTES: 'Bytov',
BITMASK: 'Bitová maska',
DUPLICATE: 'Duplicitné',
+1
View File
@@ -340,6 +340,7 @@ const sv: Translation = {
AUTO_SCROLL: 'Autoskrolla',
DASHBOARD: 'Kontrollpanel',
DEVELOPER_MODE: 'Utvecklarläge',
DISABLE_RESET: 'Inaktivera fabriksåterställning',
BYTES: 'Bytes',
BITMASK: 'Bitmask',
DUPLICATE: 'Dublett',
+1
View File
@@ -340,6 +340,7 @@ const tr: Translation = {
AUTO_SCROLL: 'Otomatik kaydırma',
DASHBOARD: 'Kontrol Paneli',
DEVELOPER_MODE: 'Geliştirici Modu',
DISABLE_RESET: 'Fabrika ayarlarını devre dışı bırak',
BYTES: 'Bayt',
BITMASK: 'Bit Maskesi',
DUPLICATE: 'Çift',
+1
View File
@@ -61,6 +61,7 @@ export interface SystemStatus {
}[];
status: number; // System Status Codes which matches SYSTEM_STATUS in System.h
developer_mode: boolean;
disable_reset: boolean;
temperature?: number;
}
+5
View File
@@ -62,11 +62,16 @@ MqttClient::MqttClient(espMqttClientTypes::UseInternalTask useInternalTask, uint
_xSemaphore = xSemaphoreCreateMutex();
EMC_SEMAPHORE_GIVE(); // release before first use
if (_useInternalTask == espMqttClientTypes::UseInternalTask::YES) {
#ifdef CONFIG_FREERTOS_UNICORE
// no core to pin to on single-core targets (S2, C3, C6)
xTaskCreate((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle);
#else
if (core > 1) {
xTaskCreate((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle);
} else {
xTaskCreatePinnedToCore((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle, core);
}
#endif
}
#else
(void) useInternalTask;
+5 -1
View File
@@ -154,8 +154,12 @@ class Outbox {
if (!it) return;
Node* node = it._node;
Node* prev = it._prev;
++it;
Node* next = node->next;
_remove(prev, node);
it._prev = prev;
it._node = next;
}
// remove current node, current points to next
+2 -2
View File
@@ -13,7 +13,7 @@
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
"formidable": "^3.5.4",
"itty-router": "^5.0.24",
"prettier": "^3.9.5"
"prettier": "^3.9.6"
},
"packageManager": "pnpm@11.13.1+sha512.b2fc7683b8a6525414e7d13e1ba28caaddde96bf66ec540bfaeb7e702b81f3e0be4d1f295edf7f9fe0396740a8dce4509c582ddf79891f4543fea32d37645f25"
"packageManager": "pnpm@11.17.0+sha512.cca3cea332ad254bb84145f966d19f4879615210346fc92c79a047f23a0d7b3cca3c3792f0076ba1f1831d277efbcf0a9119b31a9a60eca7fb3d6231f331ef72"
}
+8 -8
View File
@@ -13,7 +13,7 @@ importers:
version: 3.1.3
'@trivago/prettier-plugin-sort-imports':
specifier: ^6.0.2
version: 6.0.2(prettier@3.9.5)
version: 6.0.2(prettier@3.9.6)
formidable:
specifier: ^3.5.4
version: 3.5.4
@@ -21,8 +21,8 @@ importers:
specifier: ^5.0.24
version: 5.0.24
prettier:
specifier: ^3.9.5
version: 3.9.5
specifier: ^3.9.6
version: 3.9.6
packages:
@@ -167,8 +167,8 @@ packages:
picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
prettier@3.9.5:
resolution: {integrity: sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==}
prettier@3.9.6:
resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==}
engines: {node: '>=14'}
hasBin: true
@@ -246,7 +246,7 @@ snapshots:
dependencies:
'@noble/hashes': 1.8.0
'@trivago/prettier-plugin-sort-imports@6.0.2(prettier@3.9.5)':
'@trivago/prettier-plugin-sort-imports@6.0.2(prettier@3.9.6)':
dependencies:
'@babel/generator': 7.29.7
'@babel/parser': 7.29.7
@@ -256,7 +256,7 @@ snapshots:
lodash-es: 4.18.1
minimatch: 9.0.9
parse-imports-exports: 0.2.4
prettier: 3.9.5
prettier: 3.9.6
transitivePeerDependencies:
- supports-color
@@ -311,6 +311,6 @@ snapshots:
picocolors@1.1.1: {}
prettier@3.9.5: {}
prettier@3.9.6: {}
wrappy@1.0.2: {}
+19 -4
View File
@@ -64,7 +64,8 @@ let settings = {
modbus_port: 502,
modbus_max_clients: 10,
modbus_timeout: 10000,
developer_mode: true
developer_mode: true,
disable_reset: false
};
// EMS-ESP System Settings
@@ -129,6 +130,7 @@ let system_status = {
],
// partitions: [],
developer_mode: settings.developer_mode,
disable_reset: settings.disable_reset,
model: '',
board: '',
// model: 'BBQKees Electronics EMS Gateway E32 V2 (E32 V2.0 P3/2024011)',
@@ -1063,6 +1065,18 @@ const emsesp_coredata = {
v: '01.20',
e: 0,
url: 'gateway'
},
{
id: 13,
tn: 'Connect',
t: 12,
b: '',
n: 'Easy Connect',
d: 2,
p: 206,
v: '12.34',
e: 0,
url: 'connect'
}
]
};
@@ -4709,6 +4723,7 @@ router
settings = await request.json();
console.log('application settings saved', settings);
system_status.developer_mode = settings.developer_mode;
system_status.disable_reset = settings.disable_reset;
return status(200); // no restart needed
// return status(205); // reboot required
})
@@ -4716,9 +4731,9 @@ router
// Device Data
.get(EMSESP_CORE_DATA_ENDPOINT, () => {
// remove gateway and connect devices
emsesp_coredata.devices = emsesp_coredata.devices.filter(
(item) => item.t !== 11 && item.t !== 12
);
// emsesp_coredata.devices = emsesp_coredata.devices.filter(
// (item) => item.t !== 11 && item.t !== 12
// );
// sort by type, like its done in the C++ code
let sorted_devices = [...emsesp_coredata.devices].sort((a, b) => a.t - b.t);
// append emsesp_coredata to sorted_devices so Custom is always at the end of the list
+2 -2
View File
@@ -89,8 +89,8 @@ board_build.filesystem = littlefs
board_build.littlefs_version = 2.0
lib_deps =
bblanchon/ArduinoJson @ 7.4.3
ESP32Async/AsyncTCP @ 3.4.10
ESP32Async/ESPAsyncWebServer @ 3.11.2
ESP32Async/AsyncTCP @ 3.5.0
ESP32Async/ESPAsyncWebServer @ 3.12.0
https://github.com/mobizt/ReadyMail.git @ 0.4.2
https://github.com/mobizt/ESP_SSLClient.git @ 3.1.3
; https://github.com/emsesp/EMS-ESP-Modules.git @ 1.0.8
+5 -5
View File
@@ -27,10 +27,10 @@ npx cspell "**"
# build files that go into docs folder
# platformio run -e build_modbus -t clean
# platformio run -e build_modbus
# platformio run -e build_standalone -t clean
# platformio run -e build_standalone
platformio run -e build_modbus -t clean
platformio run -e build_modbus
platformio run -e build_standalone -t clean
platformio run -e build_standalone
# run tests
# platformio run -e native-test -t exec
platformio run -e native-test -t exec
+1 -1
View File
@@ -814,7 +814,7 @@ std::string Helpers::toUpper(std::string const & s) {
// capitalizes one UTF-8 character in char array
// works with Latin1 (1 byte), Polish and other (2 bytes) characters
// supports special characters for all 11 supported languages: EN, DE, NL, SV, PL, NO, FR, TR, IT, SK, CZ
// supports special characters for all 11 supported languages: EN, DE, NL, SV, PL, NO, FR, TR, IT, SK, CS
#if defined(EMSESP_STANDALONE)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtype-limits"
+1 -1
View File
@@ -131,7 +131,7 @@ void LED::led_fast_flash() {
set_led(led_flash_state_ ? Color::YELLOW : Color::OFF); // Yellow
}
// after duration, turn off the LED
// after duration, turn off the LED, and call the format command
if (current_time - led_flash_start_time_ >= led_flash_duration_) {
set_led(Color::OFF);
led_fast_flash_timer_ = false;
+3 -3
View File
@@ -30,9 +30,9 @@
#define EMSESP_LOCALE_TR "tr"
#define EMSESP_LOCALE_IT "it"
#define EMSESP_LOCALE_SK "sk"
#define EMSESP_LOCALE_CZ "cz"
#define EMSESP_LOCALE_CS "cs"
// IMPORTANT! translations are in the order: en, de, nl, sv, pl, no, fr, tr, it, sk, cz
// IMPORTANT! translations are in the order: en, de, nl, sv, pl, no, fr, tr, it, sk, cs
//
// if there is no translation, it will default to en
@@ -369,7 +369,7 @@ MAKE_WORD_TRANSLATION(bookshelf, "mdi:bookshelf", "mdi:bookshelf")
// MQTT Discovery - this is special device entity for 'climate'
MAKE_TRANSLATION(haclimate, "haclimate", "mqtt discovery current room temperature", "Discovery aktuelle Raumtemperatur", "Discovery huidige kamertemperatuur", "MQTT Discovery för aktuell rumstemperatur", "termostat w HA", "HA Avlest temp", "découverte mqtt température actuelle", "Güncel osa sıcaklığı", "verifica temperatura ambiente attuale", "mqtt discovery aktuálna teplota v miestnosti", "mqtt discovery aktuální pokojová teplota")
// Entity translations: tag, mqtt, en, de, nl, sv, pl, no, fr, tr, it, sk, cz
// Entity translations: tag, mqtt, en, de, nl, sv, pl, no, fr, tr, it, sk, cs
// Boiler
MAKE_TRANSLATION(chimneysweeper, "chimneysweeper", "chimney sweeper", "Schornsteinfeger", "schoorsteenveger", "Sotare", "tryb kominiarza", "feier", "ramoneur", "baca temizleyici", "spazzacamino", "kominár", "kominík")
MAKE_TRANSLATION(reset, "reset", "reset", "Reset", "Reset", "Återställ", "kasowanie komunikatu", "nullstill", "reset", "Sıfırla", "Reset", "reset", "reset")
+18 -1
View File
@@ -71,7 +71,7 @@ const char * const languages[] = {EMSESP_LOCALE_EN,
EMSESP_LOCALE_TR,
EMSESP_LOCALE_IT,
EMSESP_LOCALE_SK,
EMSESP_LOCALE_CZ};
EMSESP_LOCALE_CS};
#endif
static constexpr uint8_t NUM_LANGUAGES = sizeof(languages) / sizeof(const char *);
@@ -677,6 +677,7 @@ void System::store_settings(WebSettings & settings) {
locale_ = settings.locale;
system_name_ = settings.system_name;
developer_mode_ = settings.developer_mode;
disable_reset_ = settings.disable_reset;
}
// Starts up core services
@@ -761,6 +762,10 @@ void System::button_OnLongPress(PButton & b) {
// button indefinite press
void System::button_OnVLongPress(PButton & b) {
if (EMSESP::system_.disable_reset()) {
LOG_NOTICE("Factory reset disabled");
return;
}
LOG_NOTICE("Button pressed - very long press - perform factory reset");
EMSESP::led_.start_led_fast_flash(5); // Start LED flash timer for 5 seconds
}
@@ -1632,6 +1637,11 @@ bool System::check_upgrade() {
return StateUpdateResult::CHANGED;
}
}
// Migrate language from cz to cs
if (settings.locale == "cz") {
settings.locale = "cs";
return StateUpdateResult::CHANGED;
}
return StateUpdateResult::UNCHANGED;
});
} else if (this_version < settings_version) {
@@ -2641,6 +2651,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject output
node["modbusEnabled"] = settings.modbus_enabled;
node["forceHeatingOff"] = settings.boiler_heatingoff;
node["developerMode"] = settings.developer_mode;
node["disableReset"] = settings.disable_reset;
});
// Devices - show EMS devices if we have any
@@ -2865,6 +2876,12 @@ bool System::command_txpause(const char * value, const int8_t id) {
// format command - factory reset, removing all config files
bool System::command_format(const char * value, const int8_t id) {
if (EMSESP::system_.disable_reset()) {
LOG_NOTICE("Factory reset disabled");
return false;
}
#if !defined(EMSESP_STANDALONE) && !defined(EMSESP_TEST)
// don't really format the filesystem in test or standalone mode
if (LittleFS.format()) {
+9
View File
@@ -199,6 +199,14 @@ class System {
developer_mode_ = developer_mode;
}
bool disable_reset() {
return disable_reset_;
}
void disable_reset(bool disable_reset) {
disable_reset_ = disable_reset;
}
// Boolean Format API/MQTT
uint8_t bool_format() {
return bool_format_;
@@ -438,6 +446,7 @@ class System {
uint8_t modbus_max_clients_;
uint32_t modbus_timeout_;
bool developer_mode_;
bool disable_reset_;
uint32_t fstotal_;
uint32_t psram_;
uint32_t appused_;
+1 -1
View File
@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.9.0-dev.17"
#define EMSESP_APP_VERSION "3.9.0-dev.18"
+1 -1
View File
@@ -373,7 +373,7 @@ std::string WebCommandService::get_metrics_prometheus() {
if (ci.name[0] == '\0') {
continue;
}
result += (std::string) "# HELP emsesp_cmd_" + ci.name + " " + ci.name + ", readabe, writable, visible\n";
result += (std::string) "# HELP emsesp_cmd_" + ci.name + " " + ci.name + ", readable, writable, visible\n";
result += (std::string) "# TYPE emsesp_cmd_" + ci.name + " gauge\n";
result += (std::string) "emsesp_cmd_" + ci.name + " 1\n";
}
-3
View File
@@ -64,8 +64,6 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
// list is already sorted by device type
JsonArray devices = root["devices"].to<JsonArray>();
for (const auto & emsdevice : EMSESP::emsdevices) {
// ignore controller and gateway
if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::CONTROLLER && emsdevice->device_type() != EMSdevice::DeviceType::GATEWAY && emsdevice->count_entities() > 0)) {
JsonObject obj = devices.add<JsonObject>();
obj["id"] = emsdevice->unique_id(); // a unique id
obj["tn"] = emsdevice->device_type_2_device_name_translated(); // translated device type name
@@ -77,7 +75,6 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
obj["v"] = emsdevice->version(); // version
obj["e"] = emsdevice->count_entities(); // number of entities
obj["url"] = emsdevice->device_type_name(); // non-translated, lower-case, used for API URL in customization page
}
}
// add any custom entities
+4
View File
@@ -84,6 +84,7 @@ void WebSettings::read(WebSettings & settings, JsonObject root) {
root["modbus_max_clients"] = settings.modbus_max_clients;
root["modbus_timeout"] = settings.modbus_timeout;
root["developer_mode"] = settings.developer_mode;
root["disable_reset"] = settings.disable_reset;
root["email_enabled"] = settings.email_enabled;
root["email_security"] = settings.email_security;
root["email_server"] = settings.email_server;
@@ -306,6 +307,9 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) {
settings.developer_mode = root["developer_mode"];
EMSESP::system_.developer_mode(settings.developer_mode);
settings.disable_reset = root["disable_reset"];
EMSESP::system_.disable_reset(settings.disable_reset);
settings.bool_dashboard = root["bool_dashboard"] | EMSESP_DEFAULT_BOOL_FORMAT;
EMSESP::system_.bool_dashboard(settings.bool_dashboard);
+2 -1
View File
@@ -121,7 +121,8 @@ class WebSettings {
uint8_t eth_clock_mode;
bool developer_mode; // developer mode
bool disable_reset; // disable reset
static void read(WebSettings & settings, JsonObject root);
static StateUpdateResult update(JsonObject root, WebSettings & settings);
+2 -1
View File
@@ -172,7 +172,8 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) {
}
root["developer_mode"] = EMSESP::system_.developer_mode();
root["disable_reset"] = EMSESP::system_.disable_reset();
// Also used in SystemMonitor.tsx
root["status"] = EMSESP::system_.systemStatus(); // send the status. See System.h for status codes
if (EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_PENDING_RESTART) {
File diff suppressed because one or more lines are too long
+1
View File
@@ -131,6 +131,7 @@
"modbus_max_clients": 10,
"modbus_timeout": 300,
"developer_mode": true,
"disable_reset": false,
"email_enabled": false,
"email_security": 2,
"email_server": "smtp.example.net",
+2 -1
View File
@@ -132,7 +132,8 @@
"modbus_port": 502,
"modbus_max_clients": 10,
"modbus_timeout": 300,
"developer_mode": true
"developer_mode": true,
"disable_reset": false
}
},
{