Skip to content

Commit

Permalink
Merge pull request #27 from FauthD:main
Browse files Browse the repository at this point in the history
Add global names to Dallas sensors to avoid ugly <unknown> and other …
  • Loading branch information
proddy authored Mar 16, 2021
2 parents c17749b + 4d6354d commit 478e636
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pio_local.ini
# OS specific
.DS_Store
*Thumbs.db
.directory

# project specfic
/scripts/stackdmp.txt
Expand All @@ -25,4 +26,6 @@ emsesp
/interface/build
/interface/node_modules
/interface/.eslintcache

# /interface/package-lock.json # this file will be modified by npm! What can we do here?
package-lock.json
package.json
5 changes: 4 additions & 1 deletion src/dallassensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,11 @@ void DallasSensor::publish_values(const bool force) {
config["uniq_id"] = str;

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");
ids.add("ems-esp");
ids.add("ems-esp-dallas"); // Different ids as the other portions of the EMS-ESP

char topic[100];
if (dallas_format == Mqtt::Dallas_Format::SENSORID) {
Expand Down
8 changes: 8 additions & 0 deletions workspace.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}

0 comments on commit 478e636

Please sign in to comment.