Merge pull request #2187 from proddy/dev

fix lint warnings
This commit is contained in:
Proddy
2024-11-07 12:17:33 +01:00
committed by GitHub
3 changed files with 20 additions and 19 deletions

View File

@@ -35,7 +35,7 @@
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"react-icons": "^5.3.0", "react-icons": "^5.3.0",
"react-router-dom": "^6.27.0", "react-router-dom": "^6.28.0",
"react-toastify": "^10.0.6", "react-toastify": "^10.0.6",
"typesafe-i18n": "^5.26.2", "typesafe-i18n": "^5.26.2",
"typescript": "^5.6.3" "typescript": "^5.6.3"

View File

@@ -1133,10 +1133,10 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@remix-run/router@npm:1.20.0": "@remix-run/router@npm:1.21.0":
version: 1.20.0 version: 1.21.0
resolution: "@remix-run/router@npm:1.20.0" resolution: "@remix-run/router@npm:1.21.0"
checksum: 10c0/2e017dea530717a6e93a16d478714c4c9165313a1c48e39172ec609bc20324ca6362e8ee2243602df6343644c9268d82a3f50f154d3bb8a17dddde6c37be6e83 checksum: 10c0/570792211c083a1c7146613b79cbb8e0d1e14f34e974052e060e7f9dcad38c800d80fe0a18bf42811bc278ab12c0e8fd62cfce649e905046c4e55bd5a09eafdc
languageName: node languageName: node
linkType: hard linkType: hard
@@ -1688,7 +1688,7 @@ __metadata:
react: "npm:^18.3.1" react: "npm:^18.3.1"
react-dom: "npm:^18.3.1" react-dom: "npm:^18.3.1"
react-icons: "npm:^5.3.0" react-icons: "npm:^5.3.0"
react-router-dom: "npm:^6.27.0" react-router-dom: "npm:^6.28.0"
react-toastify: "npm:^10.0.6" react-toastify: "npm:^10.0.6"
rollup-plugin-visualizer: "npm:^5.12.0" rollup-plugin-visualizer: "npm:^5.12.0"
terser: "npm:^5.36.0" terser: "npm:^5.36.0"
@@ -5750,27 +5750,27 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"react-router-dom@npm:^6.27.0": "react-router-dom@npm:^6.28.0":
version: 6.27.0 version: 6.28.0
resolution: "react-router-dom@npm:6.27.0" resolution: "react-router-dom@npm:6.28.0"
dependencies: dependencies:
"@remix-run/router": "npm:1.20.0" "@remix-run/router": "npm:1.21.0"
react-router: "npm:6.27.0" react-router: "npm:6.28.0"
peerDependencies: peerDependencies:
react: ">=16.8" react: ">=16.8"
react-dom: ">=16.8" react-dom: ">=16.8"
checksum: 10c0/7db48ffd0b387af0eed060ceaf42075d074e63fbd30f4cf60993526b3610883a9ff82615965001165ed69d2bf2f1bce05c594a21c8d0d845e7b9bf203201116e checksum: 10c0/e2930cf83e8c843a932b008c7ce11059fd83390502a433f0e41f192e3cb80081a621d069eeda7af3cf4bf74d7f8029f0141cdce741bca3f0af82d4bbbc7f7f10
languageName: node languageName: node
linkType: hard linkType: hard
"react-router@npm:6.27.0": "react-router@npm:6.28.0":
version: 6.27.0 version: 6.28.0
resolution: "react-router@npm:6.27.0" resolution: "react-router@npm:6.28.0"
dependencies: dependencies:
"@remix-run/router": "npm:1.20.0" "@remix-run/router": "npm:1.21.0"
peerDependencies: peerDependencies:
react: ">=16.8" react: ">=16.8"
checksum: 10c0/440d6ee00890cec92a0c2183164149fbb96363efccf52bb132a964f44e51aec2f4b5a0520c67f6f17faddaa4097090fd76f7efe58263947532fceeb11dd4cdf3 checksum: 10c0/b435510de78fd882bf6ca9800a73cd90cee418bd1d19efd91b8dcaebde36929bbb589e25d9f7eec24ceb84255e8d538bc1fe54e6ddb5c43c32798e2b720fa76d
languageName: node languageName: node
linkType: hard linkType: hard

View File

@@ -937,7 +937,8 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
// create the topic // create the topic
// depending on the type and whether the device entity is writable (i.e. a command) // depending on the type and whether the device entity is writable (i.e. a command)
// https://developers.home-assistant.io/docs/core/entity // https://developers.home-assistant.io/docs/core/entity
char topic[MQTT_TOPIC_MAX_SIZE] = {0}; char topic[MQTT_TOPIC_MAX_SIZE];
topic[0] = '\0'; // nullify, making it empty
if (has_cmd) { if (has_cmd) {
// if it's a command then we can use Number, Switch, Select or Text. Otherwise stick to Sensor // if it's a command then we can use Number, Switch, Select or Text. Otherwise stick to Sensor
switch (type) { switch (type) {
@@ -981,7 +982,7 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
} }
// if at this point we don't have a topic created yet, create a default sensor one. We always need a topic. // if at this point we don't have a topic created yet, create a default sensor one. We always need a topic.
if (strlen(topic) == 0) { if (!strnlen(topic, sizeof(topic))) {
snprintf(topic, sizeof(topic), (type == DeviceValueType::BOOL) ? "binary_sensor/%s" : "sensor/%s", config_topic); // binary sensor (for booleans) snprintf(topic, sizeof(topic), (type == DeviceValueType::BOOL) ? "binary_sensor/%s" : "sensor/%s", config_topic); // binary sensor (for booleans)
} }