mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-09 15:45:46 +00:00
door sensor should not post availbility topic because it goes to sleep most of the time (for HA discovery)
This commit is contained in:
@ -200,8 +200,11 @@ HassDeviceInfo* hass_init_device_info(ENTITY_TYPE type, int index, char* payload
|
||||
// remove availability information for sensor to keep last value visible on Home Assistant
|
||||
bool flagavty = false;
|
||||
flagavty = CFG_HasFlag(OBK_FLAG_NOT_PUBLISH_AVAILABILITY_SENSOR);
|
||||
if (!isSensor || !flagavty) {
|
||||
cJSON_AddStringToObject(info->root, "avty_t", "~/connected"); //availability_topic, `online` value is broadcasted
|
||||
// if door sensor is running, then deep sleep will be invoked mostly, then we dont want availability
|
||||
if (DRV_IsRunning("DoorSensor") == false) {
|
||||
if (!isSensor || !flagavty) {
|
||||
cJSON_AddStringToObject(info->root, "avty_t", "~/connected"); //availability_topic, `online` value is broadcasted
|
||||
}
|
||||
}
|
||||
|
||||
if (!isSensor) { //Sensors (except binary_sensor) don't use payload
|
||||
|
||||
Reference in New Issue
Block a user