mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
Merge pull request #27 from FauthD:main
Add global names to Dallas sensors to avoid ugly <unknown> and other …
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -16,6 +16,7 @@ pio_local.ini
|
|||||||
# OS specific
|
# OS specific
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*Thumbs.db
|
*Thumbs.db
|
||||||
|
.directory
|
||||||
|
|
||||||
# project specfic
|
# project specfic
|
||||||
/scripts/stackdmp.txt
|
/scripts/stackdmp.txt
|
||||||
@@ -25,4 +26,6 @@ emsesp
|
|||||||
/interface/build
|
/interface/build
|
||||||
/interface/node_modules
|
/interface/node_modules
|
||||||
/interface/.eslintcache
|
/interface/.eslintcache
|
||||||
|
# /interface/package-lock.json # this file will be modified by npm! What can we do here?
|
||||||
|
package-lock.json
|
||||||
|
package.json
|
||||||
|
|||||||
@@ -379,8 +379,11 @@ void DallasSensor::publish_values(const bool force) {
|
|||||||
config["uniq_id"] = str;
|
config["uniq_id"] = str;
|
||||||
|
|
||||||
JsonObject dev = config.createNestedObject("dev");
|
JsonObject dev = config.createNestedObject("dev");
|
||||||
|
dev["name"] = FJSON("EMS-ESP Dallas"); // Global name for device (all Dallas sensors, avoids using the very first name for the group)
|
||||||
|
dev["mf"] = FJSON("Dallas"); // Manufacturer (avoids the ugly <unknown> in HA)
|
||||||
|
dev["mdl"] = FJSON("1Wire"); // Model (avoids the ugly <unknown> in HA)
|
||||||
JsonArray ids = dev.createNestedArray("ids");
|
JsonArray ids = dev.createNestedArray("ids");
|
||||||
ids.add("ems-esp");
|
ids.add("ems-esp-dallas"); // Different ids as the other portions of the EMS-ESP
|
||||||
|
|
||||||
char topic[100];
|
char topic[100];
|
||||||
if (dallas_format == Mqtt::Dallas_Format::SENSORID) {
|
if (dallas_format == Mqtt::Dallas_Format::SENSORID) {
|
||||||
|
|||||||
8
workspace.code-workspace
Normal file
8
workspace.code-workspace
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user