mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-03-20 17:28:37 +05:00
fix: HaHelper::publishDynamicSensor() for DHT sensors fixed
This commit is contained in:
@@ -176,9 +176,10 @@ public:
|
|||||||
objId.c_str()
|
objId.c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
// set device class, name, value template for bluetooth sensors
|
// set device class, name, value template for Bluetooth/DHT sensors
|
||||||
// or name & value template for another sensors
|
// or name & value template for another sensors
|
||||||
if (sSensor.type == Sensors::Type::BLUETOOTH) {
|
if (sSensor.type == Sensors::Type::BLUETOOTH ||
|
||||||
|
sSensor.type == Sensors::Type::DHT11 || sSensor.type == Sensors::Type::DHT22) {
|
||||||
// available state topic
|
// available state topic
|
||||||
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = doc[FPSTR(HA_STATE_TOPIC)];
|
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = doc[FPSTR(HA_STATE_TOPIC)];
|
||||||
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_SENSOR_CONN, true);
|
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_SENSOR_CONN, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user