mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
Merge pull request #1633 from proddy/dev
fix issue with HA, removing availability check for online status as it may not have been published in time
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
"@types/imagemin": "^8.0.5",
|
"@types/imagemin": "^8.0.5",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/node": "^20.11.20",
|
"@types/node": "^20.11.20",
|
||||||
"@types/react": "^18.2.57",
|
"@types/react": "^18.2.58",
|
||||||
"@types/react-dom": "^18.2.19",
|
"@types/react-dom": "^18.2.19",
|
||||||
"@types/react-router-dom": "^5.3.3",
|
"@types/react-router-dom": "^5.3.3",
|
||||||
"alova": "^2.17.0",
|
"alova": "^2.17.0",
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
"preact": "^10.19.6",
|
"preact": "^10.19.6",
|
||||||
"prettier": "^3.2.5",
|
"prettier": "^3.2.5",
|
||||||
"rollup-plugin-visualizer": "^5.12.0",
|
"rollup-plugin-visualizer": "^5.12.0",
|
||||||
"terser": "^5.27.2",
|
"terser": "^5.28.1",
|
||||||
"vite": "^5.1.4",
|
"vite": "^5.1.4",
|
||||||
"vite-plugin-imagemin": "^0.6.1",
|
"vite-plugin-imagemin": "^0.6.1",
|
||||||
"vite-tsconfig-paths": "^4.3.1"
|
"vite-tsconfig-paths": "^4.3.1"
|
||||||
|
|||||||
@@ -1670,14 +1670,14 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@types/react@npm:^18.2.57":
|
"@types/react@npm:^18.2.58":
|
||||||
version: 18.2.57
|
version: 18.2.58
|
||||||
resolution: "@types/react@npm:18.2.57"
|
resolution: "@types/react@npm:18.2.58"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/prop-types": "npm:*"
|
"@types/prop-types": "npm:*"
|
||||||
"@types/scheduler": "npm:*"
|
"@types/scheduler": "npm:*"
|
||||||
csstype: "npm:^3.0.2"
|
csstype: "npm:^3.0.2"
|
||||||
checksum: 10/beee45a8ee48862fb5101f6ebdd89ccc20c5a6df29dcd2315560bc3b57ea3af8d09a8e9bb1c58063a70f9010e0d2c7bd300819438e2ca62810285c3d7275ab5a
|
checksum: 10/ec5e1a7d8acc55551efec7a3d63441d24c7e94b66bf8039944541a8408048668e51b7b4b0b6e8303cdea271b7c6da242cdc7bb8ca501eedf822956edbdbfc67e
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -1859,7 +1859,7 @@ __metadata:
|
|||||||
"@types/imagemin": "npm:^8.0.5"
|
"@types/imagemin": "npm:^8.0.5"
|
||||||
"@types/lodash-es": "npm:^4.17.12"
|
"@types/lodash-es": "npm:^4.17.12"
|
||||||
"@types/node": "npm:^20.11.20"
|
"@types/node": "npm:^20.11.20"
|
||||||
"@types/react": "npm:^18.2.57"
|
"@types/react": "npm:^18.2.58"
|
||||||
"@types/react-dom": "npm:^18.2.19"
|
"@types/react-dom": "npm:^18.2.19"
|
||||||
"@types/react-router-dom": "npm:^5.3.3"
|
"@types/react-router-dom": "npm:^5.3.3"
|
||||||
"@typescript-eslint/eslint-plugin": "npm:^7.0.2"
|
"@typescript-eslint/eslint-plugin": "npm:^7.0.2"
|
||||||
@@ -1890,7 +1890,7 @@ __metadata:
|
|||||||
react-toastify: "npm:^10.0.4"
|
react-toastify: "npm:^10.0.4"
|
||||||
rollup-plugin-visualizer: "npm:^5.12.0"
|
rollup-plugin-visualizer: "npm:^5.12.0"
|
||||||
sockette: "npm:^2.0.6"
|
sockette: "npm:^2.0.6"
|
||||||
terser: "npm:^5.27.2"
|
terser: "npm:^5.28.1"
|
||||||
typesafe-i18n: "npm:^5.26.2"
|
typesafe-i18n: "npm:^5.26.2"
|
||||||
typescript: "npm:^5.3.3"
|
typescript: "npm:^5.3.3"
|
||||||
vite: "npm:^5.1.4"
|
vite: "npm:^5.1.4"
|
||||||
@@ -8312,9 +8312,9 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"terser@npm:^5.27.2":
|
"terser@npm:^5.28.1":
|
||||||
version: 5.27.2
|
version: 5.28.1
|
||||||
resolution: "terser@npm:5.27.2"
|
resolution: "terser@npm:5.28.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jridgewell/source-map": "npm:^0.3.3"
|
"@jridgewell/source-map": "npm:^0.3.3"
|
||||||
acorn: "npm:^8.8.2"
|
acorn: "npm:^8.8.2"
|
||||||
@@ -8322,7 +8322,7 @@ __metadata:
|
|||||||
source-map-support: "npm:~0.5.20"
|
source-map-support: "npm:~0.5.20"
|
||||||
bin:
|
bin:
|
||||||
terser: bin/terser
|
terser: bin/terser
|
||||||
checksum: 10/589f1112d6cd7653f6e2d4a38970e97a160de01cddb214dc924aa330c22b8c3635067a47db1233e060e613e380b979ca336c3211b17507ea13b0adff10ecbd40
|
checksum: 10/922159f036a89a7d01b8b67e0eacb4425c20cf19067d2e82c1523153ed3bf66c36b945fd16c610b7ea41fedb867b189d2a350415fb566f4668a1701ab768728e
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|||||||
12
src/mqtt.cpp
12
src/mqtt.cpp
@@ -1312,13 +1312,13 @@ void Mqtt::add_ha_sections_to_doc(const char * name,
|
|||||||
|
|
||||||
const char * tpl_draft = "{{'online' if %s else 'offline'}}";
|
const char * tpl_draft = "{{'online' if %s else 'offline'}}";
|
||||||
|
|
||||||
// EMS-ESP status check
|
|
||||||
char tpl[150];
|
char tpl[150];
|
||||||
snprintf(tpl, sizeof(tpl), "%s/status", Mqtt::base().c_str());
|
// EMS-ESP status check
|
||||||
avty_json["t"] = tpl;
|
// snprintf(tpl, sizeof(tpl), "%s/status", Mqtt::base().c_str());
|
||||||
snprintf(tpl, sizeof(tpl), tpl_draft, "value == 'online'");
|
// avty_json["t"] = tpl;
|
||||||
avty_json["val_tpl"] = tpl;
|
// snprintf(tpl, sizeof(tpl), tpl_draft, "value == 'online'");
|
||||||
avty.add(avty_json); // returns 0 if no mem
|
// avty_json["val_tpl"] = tpl;
|
||||||
|
// avty.add(avty_json); // returns 0 if no mem
|
||||||
|
|
||||||
// skip conditional Jinja2 templates if not home assistant
|
// skip conditional Jinja2 templates if not home assistant
|
||||||
if (discovery_type() == discoveryType::HOMEASSISTANT) {
|
if (discovery_type() == discoveryType::HOMEASSISTANT) {
|
||||||
|
|||||||
Reference in New Issue
Block a user