update temperature unit to work in HA (#768)

* update temperature unit to work in HA
* use only one temperature sensor for HA
This commit is contained in:
orrpan authored and GitHub committed 2020-10-04 14:56:34 -05:00
1 parent 7cd1e9a1ab
commit 03ab7f7d0e
3 files changed
+31 -63

No files matched your search

+1 -10
View File
@@ -102,15 +102,6 @@ void pubOneWire_HADiscovery() {
# ifdef ZmqttDiscovery
Log.notice(F("CreateDiscoverySensor - Found %d" CR), ds1820_count);
for (int index = 0; index < ds1820_count; index++) {
createDiscovery("sensor",
(char*)(String(OW_TOPIC) + "/" + ds1820_addr[index]).c_str(),
(char*)("DS12B20_" + String(index + 1) + "_f").c_str(),
(char*)(ds1820_addr[index] + "_f").c_str(),
will_Topic,
"temperature",
jsonTempf,
"", "", "F",
0, "", "", true, "");
createDiscovery("sensor",
(char*)(String(OW_TOPIC) + "/" + ds1820_addr[index]).c_str(),
(char*)("DS12B20_" + String(index + 1) + "_c").c_str(),
@@ -118,7 +109,7 @@ void pubOneWire_HADiscovery() {
will_Topic,
"temperature",
jsonTempc,
"", "", "C",
"", "", "°C",
0, "", "", true, "");
}
# endif