Merge pull request #3167 from proddy/core3

Core3 updates
This commit is contained in:
Proddy
2026-07-26 11:26:33 +02:00
committed by GitHub
24 changed files with 6434 additions and 6407 deletions
+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, 0x02A0,RC300Curves,
0x02A1,RC300Curves, 0x02A1,RC300Curves,
0x02A2,RC300Curves, 0x02A2,RC300Curves,
0x02A5,CRFMonitor, 0x02A5,RC300Monitor,
0x02A6,RC300Monitor, 0x02A6,RC300Monitor,
0x02A7,RC300Monitor, 0x02A7,RC300Monitor,
0x02A8,CRFMonitor, 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
+11 -11
View File
@@ -29,34 +29,34 @@
"@mui/icons-material": "^9.2.0", "@mui/icons-material": "^9.2.0",
"@mui/material": "^9.2.0", "@mui/material": "^9.2.0",
"@table-library/react-table-library": "4.1.15", "@table-library/react-table-library": "4.1.15",
"alova": "^3.5.2", "alova": "^3.5.3",
"etag": "^1.8.1", "etag": "^1.8.1",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"mime-types": "^3.0.2", "mime-types": "^3.0.2",
"preact": "^10.29.7", "preact": "^10.29.7",
"react": "^19.2.7", "react": "^19.2.8",
"react-dom": "^19.2.7", "react-dom": "^19.2.8",
"react-icons": "^5.7.0", "react-icons": "^5.7.0",
"react-router": "^8.2.0", "react-router": "^8.3.0",
"typesafe-i18n": "^5.27.1", "typesafe-i18n": "^5.27.1",
"typescript": "^6.0.3" "typescript": "^6.0.3"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^10.0.1", "@eslint/js": "^10.0.1",
"@preact/preset-vite": "^2.10.5", "@preact/preset-vite": "^2.10.6",
"@trivago/prettier-plugin-sort-imports": "^6.0.2", "@trivago/prettier-plugin-sort-imports": "^6.0.2",
"@types/node": "^26.1.1", "@types/node": "^26.1.1",
"@types/react": "^19.2.17", "@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"concurrently": "^10.0.3", "concurrently": "^10.0.4",
"eslint": "^10.7.0", "eslint": "^10.8.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"prettier": "^3.9.5", "prettier": "^3.9.6",
"rollup-plugin-visualizer": "^7.0.1", "rollup-plugin-visualizer": "^7.0.1",
"terser": "^5.49.0", "terser": "^5.49.0",
"typescript-eslint": "^8.64.0", "typescript-eslint": "^8.65.0",
"vite": "^8.1.4", "vite": "^8.1.5",
"vite-plugin-imagemin": "^0.6.1" "vite-plugin-imagemin": "^0.6.1"
}, },
"packageManager": "pnpm@11.13.1+sha512.b2fc7683b8a6525414e7d13e1ba28caaddde96bf66ec540bfaeb7e702b81f3e0be4d1f295edf7f9fe0396740a8dce4509c582ddf79891f4543fea32d37645f25" "packageManager": "pnpm@11.17.0+sha512.cca3cea332ad254bb84145f966d19f4879615210346fc92c79a047f23a0d7b3cca3c3792f0076ba1f1831d277efbcf0a9119b31a9a60eca7fb3d6231f331ef72"
} }
+333 -331
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 // (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. // into firmware flash. `en` is always kept as the fallback. Unset => embed all.
const ALL_LOCALES = [ const ALL_LOCALES = [
'cz', 'cs',
'de', 'de',
'en', 'en',
'fr', 'fr',
+1 -1
View File
@@ -20,7 +20,7 @@ const ALL_LOCALES = [
'sk', 'sk',
'sv', 'sv',
'tr', 'tr',
'cz' 'cs'
] as Locales[]; ] as Locales[];
// Optional build-time allow-list (e.g. VITE_APP_LOCALES="en,de,nl"). When unset, // 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> </MenuItem>
{devices.devices.map( {devices.devices.map(
(device: Device) => (device: Device) =>
device.id < 90 && ( device.id < 90 &&
device.e !== 0 && (
<MenuItem key={device.id} value={device.id}> <MenuItem key={device.id} value={device.id}>
{device.n}&nbsp;({device.tn}) {device.n}&nbsp;({device.tn})
</MenuItem> </MenuItem>
+15 -5
View File
@@ -558,16 +558,26 @@ const Devices = memo(() => {
<CircularProgress sx={{ margin: 1 }} size={18} /> <CircularProgress sx={{ margin: 1 }} size={18} />
)} )}
{tableList.map((device: Device) => ( {tableList.map((device: Device) => (
<Row key={device.id} item={device}> <Row key={device.id} item={device} disabled={device.e === 0}>
<Cell> <Cell>
<DeviceIcon type_id={device.t} /> <DeviceIcon type_id={device.t} />
&nbsp;&nbsp; &nbsp;&nbsp;
{device.n} <span style={{ color: device.e === 0 ? 'grey' : 'white' }}>
<span style={{ color: 'lightblue' }}> {device.n}
&nbsp;&nbsp;({device.e})
</span> </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>
<Cell stiff>{device.tn}</Cell>
</Row> </Row>
))} ))}
</Body> </Body>
@@ -548,7 +548,7 @@ const ApplicationSettings = () => {
margin="normal" margin="normal"
select select
> >
<MenuItem value="cz">Česky (CZ)</MenuItem> <MenuItem value="cs">Česky (CS)</MenuItem>
<MenuItem value="de">Deutsch (DE)</MenuItem> <MenuItem value="de">Deutsch (DE)</MenuItem>
<MenuItem value="en">English (EN)</MenuItem> <MenuItem value="en">English (EN)</MenuItem>
<MenuItem value="fr">Français (FR)</MenuItem> <MenuItem value="fr">Français (FR)</MenuItem>
@@ -4,7 +4,7 @@ import type { CSSProperties } from 'react';
import { MenuItem, TextField } from '@mui/material'; 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 DEflag from 'i18n/DE.svg';
import FRflag from 'i18n/FR.svg'; import FRflag from 'i18n/FR.svg';
import GBflag from 'i18n/GB.svg'; import GBflag from 'i18n/GB.svg';
@@ -28,7 +28,7 @@ interface LanguageOption {
} }
const LANGUAGE_OPTIONS: LanguageOption[] = [ const LANGUAGE_OPTIONS: LanguageOption[] = [
{ key: 'cz', flag: CZflag, label: 'CZ' }, { key: 'cs', flag: CSflag, label: 'CS' },
{ key: 'de', flag: DEflag, label: 'DE' }, { key: 'de', flag: DEflag, label: 'DE' },
{ key: 'en', flag: GBflag, label: 'EN' }, { key: 'en', flag: GBflag, label: 'EN' },
{ key: 'fr', flag: FRflag, label: 'FR' }, { 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'; import type { Translation } from '../i18n-types';
const cz: Translation = { const cs: Translation = {
LANGUAGE: 'Jazyk', LANGUAGE: 'Jazyk',
RETRY: 'Zkusit znovu', RETRY: 'Zkusit znovu',
LOADING: 'Načítání', LOADING: 'Načítání',
@@ -370,4 +370,4 @@ const cz: Translation = {
EXECUTE_COMMAND_SENT: 'Příkaz odeslán', EXECUTE_COMMAND_SENT: 'Příkaz odeslán',
}; };
export default cz; export default cs;
+2 -2
View File
@@ -13,7 +13,7 @@
"@trivago/prettier-plugin-sort-imports": "^6.0.2", "@trivago/prettier-plugin-sort-imports": "^6.0.2",
"formidable": "^3.5.4", "formidable": "^3.5.4",
"itty-router": "^5.0.24", "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 version: 3.1.3
'@trivago/prettier-plugin-sort-imports': '@trivago/prettier-plugin-sort-imports':
specifier: ^6.0.2 specifier: ^6.0.2
version: 6.0.2(prettier@3.9.5) version: 6.0.2(prettier@3.9.6)
formidable: formidable:
specifier: ^3.5.4 specifier: ^3.5.4
version: 3.5.4 version: 3.5.4
@@ -21,8 +21,8 @@ importers:
specifier: ^5.0.24 specifier: ^5.0.24
version: 5.0.24 version: 5.0.24
prettier: prettier:
specifier: ^3.9.5 specifier: ^3.9.6
version: 3.9.5 version: 3.9.6
packages: packages:
@@ -167,8 +167,8 @@ packages:
picocolors@1.1.1: picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
prettier@3.9.5: prettier@3.9.6:
resolution: {integrity: sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==} resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==}
engines: {node: '>=14'} engines: {node: '>=14'}
hasBin: true hasBin: true
@@ -246,7 +246,7 @@ snapshots:
dependencies: dependencies:
'@noble/hashes': 1.8.0 '@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: dependencies:
'@babel/generator': 7.29.7 '@babel/generator': 7.29.7
'@babel/parser': 7.29.7 '@babel/parser': 7.29.7
@@ -256,7 +256,7 @@ snapshots:
lodash-es: 4.18.1 lodash-es: 4.18.1
minimatch: 9.0.9 minimatch: 9.0.9
parse-imports-exports: 0.2.4 parse-imports-exports: 0.2.4
prettier: 3.9.5 prettier: 3.9.6
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@@ -311,6 +311,6 @@ snapshots:
picocolors@1.1.1: {} picocolors@1.1.1: {}
prettier@3.9.5: {} prettier@3.9.6: {}
wrappy@1.0.2: {} wrappy@1.0.2: {}
+15 -3
View File
@@ -1063,6 +1063,18 @@ const emsesp_coredata = {
v: '01.20', v: '01.20',
e: 0, e: 0,
url: 'gateway' url: 'gateway'
},
{
id: 13,
tn: 'Connect',
t: 12,
b: '',
n: 'Easy Connect',
d: 2,
p: 206,
v: '12.34',
e: 0,
url: 'connect'
} }
] ]
}; };
@@ -4716,9 +4728,9 @@ router
// Device Data // Device Data
.get(EMSESP_CORE_DATA_ENDPOINT, () => { .get(EMSESP_CORE_DATA_ENDPOINT, () => {
// remove gateway and connect devices // remove gateway and connect devices
emsesp_coredata.devices = emsesp_coredata.devices.filter( // emsesp_coredata.devices = emsesp_coredata.devices.filter(
(item) => item.t !== 11 && item.t !== 12 // (item) => item.t !== 11 && item.t !== 12
); // );
// sort by type, like its done in the C++ code // sort by type, like its done in the C++ code
let sorted_devices = [...emsesp_coredata.devices].sort((a, b) => a.t - b.t); 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 // append emsesp_coredata to sorted_devices so Custom is always at the end of the list
+1 -1
View File
@@ -89,7 +89,7 @@ board_build.filesystem = littlefs
board_build.littlefs_version = 2.0 board_build.littlefs_version = 2.0
lib_deps = lib_deps =
bblanchon/ArduinoJson @ 7.4.3 bblanchon/ArduinoJson @ 7.4.3
ESP32Async/AsyncTCP @ 3.4.10 ESP32Async/AsyncTCP @ 3.5.0
ESP32Async/ESPAsyncWebServer @ 3.11.2 ESP32Async/ESPAsyncWebServer @ 3.11.2
https://github.com/mobizt/ReadyMail.git @ 0.4.2 https://github.com/mobizt/ReadyMail.git @ 0.4.2
https://github.com/mobizt/ESP_SSLClient.git @ 3.1.3 https://github.com/mobizt/ESP_SSLClient.git @ 3.1.3
+5 -5
View File
@@ -27,10 +27,10 @@ npx cspell "**"
# build files that go into docs folder # build files that go into docs folder
# platformio run -e build_modbus -t clean platformio run -e build_modbus -t clean
# platformio run -e build_modbus platformio run -e build_modbus
# platformio run -e build_standalone -t clean platformio run -e build_standalone -t clean
# platformio run -e build_standalone platformio run -e build_standalone
# run tests # 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 // capitalizes one UTF-8 character in char array
// works with Latin1 (1 byte), Polish and other (2 bytes) characters // 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) #if defined(EMSESP_STANDALONE)
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtype-limits" #pragma GCC diagnostic ignored "-Wtype-limits"
+3 -3
View File
@@ -30,9 +30,9 @@
#define EMSESP_LOCALE_TR "tr" #define EMSESP_LOCALE_TR "tr"
#define EMSESP_LOCALE_IT "it" #define EMSESP_LOCALE_IT "it"
#define EMSESP_LOCALE_SK "sk" #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 // 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' // 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") 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 // Boiler
MAKE_TRANSLATION(chimneysweeper, "chimneysweeper", "chimney sweeper", "Schornsteinfeger", "schoorsteenveger", "Sotare", "tryb kominiarza", "feier", "ramoneur", "baca temizleyici", "spazzacamino", "kominár", "kominík") 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") MAKE_TRANSLATION(reset, "reset", "reset", "Reset", "Reset", "Återställ", "kasowanie komunikatu", "nullstill", "reset", "Sıfırla", "Reset", "reset", "reset")
+6 -1
View File
@@ -71,7 +71,7 @@ const char * const languages[] = {EMSESP_LOCALE_EN,
EMSESP_LOCALE_TR, EMSESP_LOCALE_TR,
EMSESP_LOCALE_IT, EMSESP_LOCALE_IT,
EMSESP_LOCALE_SK, EMSESP_LOCALE_SK,
EMSESP_LOCALE_CZ}; EMSESP_LOCALE_CS};
#endif #endif
static constexpr uint8_t NUM_LANGUAGES = sizeof(languages) / sizeof(const char *); static constexpr uint8_t NUM_LANGUAGES = sizeof(languages) / sizeof(const char *);
@@ -1632,6 +1632,11 @@ bool System::check_upgrade() {
return StateUpdateResult::CHANGED; return StateUpdateResult::CHANGED;
} }
} }
// Migrate language from cz to cs
if (settings.locale == "cz") {
settings.locale = "cs";
return StateUpdateResult::CHANGED;
}
return StateUpdateResult::UNCHANGED; return StateUpdateResult::UNCHANGED;
}); });
} else if (this_version < settings_version) { } else if (this_version < settings_version) {
+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') { if (ci.name[0] == '\0') {
continue; 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) "# TYPE emsesp_cmd_" + ci.name + " gauge\n";
result += (std::string) "emsesp_cmd_" + ci.name + " 1\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 // list is already sorted by device type
JsonArray devices = root["devices"].to<JsonArray>(); JsonArray devices = root["devices"].to<JsonArray>();
for (const auto & emsdevice : EMSESP::emsdevices) { 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>(); JsonObject obj = devices.add<JsonObject>();
obj["id"] = emsdevice->unique_id(); // a unique id obj["id"] = emsdevice->unique_id(); // a unique id
obj["tn"] = emsdevice->device_type_2_device_name_translated(); // translated device type name 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["v"] = emsdevice->version(); // version
obj["e"] = emsdevice->count_entities(); // number of entities 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 obj["url"] = emsdevice->device_type_name(); // non-translated, lower-case, used for API URL in customization page
}
} }
// add any custom entities // add any custom entities
+3 -3
View File
@@ -95,7 +95,7 @@ void test_19() {
} }
void test_20() { void test_20() {
auto expected_response = "[{\"name\":\"test_seltemp\",\"fullname\":\"test_seltemp\",\"storage\":\"ram\",\"type\":\"number\",\"writeable\":true,\"ent_cat\":\"diagnostic\",\"value\":\"14\"}]"; auto expected_response = "[{\"name\":\"test_seltemp\",\"fullname\":\"test_seltemp\",\"storage\":\"ram\",\"type\":\"number\",\"readable\":true,\"writeable\":true,\"visible\":true,\"ent_cat\":\"diagnostic\",\"value\":\"14\"}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/custom/test_seltemp")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/custom/test_seltemp"));
} }
@@ -105,7 +105,7 @@ void test_21() {
} }
void test_22() { void test_22() {
auto expected_response = "[{\"name\":\"test_custom\",\"fullname\":\"test_custom\",\"storage\":\"ems\",\"type\":\"number\",\"writeable\":true,\"device_id\":\"0x08\",\"type_id\":\"0x18\",\"offset\":0,\"factor\":1,\"ent_cat\":\"diagnostic\",\"uom\":\"°C\",\"state_class\":\"measurement\",\"device_class\":\"temperature\",\"value\":0}]"; auto expected_response = "[{\"name\":\"test_custom\",\"fullname\":\"test_custom\",\"storage\":\"ems\",\"type\":\"number\",\"readable\":true,\"writeable\":true,\"visible\":true,\"device_id\":\"0x08\",\"type_id\":\"0x18\",\"offset\":0,\"factor\":1,\"ent_cat\":\"diagnostic\",\"uom\":\"°C\",\"state_class\":\"measurement\",\"device_class\":\"temperature\",\"value\":0}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/custom/test_custom")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/custom/test_custom"));
} }
@@ -230,7 +230,7 @@ void test_46() {
} }
void test_47() { void test_47() {
auto expected_response = "[{\"name\":\"test_scheduler2\",\"fullname\":\"test_scheduler2\",\"type\":\"boolean\",\"active\":\"on\",\"timer\":\"01:00\",\"cmd_name\":\"send_message\"}]"; auto expected_response = "[{\"name\":\"test_scheduler2\",\"fullname\":\"test_scheduler2\",\"type\":\"boolean\",\"value\":\"on\",\"timer\":\"01:00\",\"cmd_name\":\"send_message\",\"readable\":true,\"writeable\":true,\"visible\":true}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/scheduler/test_scheduler2")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/scheduler/test_scheduler2"));
} }