mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-05-11 03:48:16 +05:00
feat: added support DHT11/DHT22 sensors (#223)
* feat: Added support DHT11/DHT22 sensors * chore: formatting * fix: typo * fix: `HaHelper::publishDynamicSensor()` for DHT sensors fixed * refactor: optimization of wired sensors
This commit is contained in:
+3
-2
@@ -176,9 +176,10 @@ public:
|
||||
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
|
||||
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
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user