This commit is contained in:
Tester23
2024-08-24 15:38:53 +02:00
parent 9acb13af35
commit 3e5a71fd74
3 changed files with 16 additions and 2 deletions

View File

@ -490,11 +490,11 @@ int http_fn_index(http_request_t* request) {
hprintf255(request, "Channel %s = %i", CHANNEL_GetLabel(i), iValue);
poststr(request, "</td></tr>");
}
else if (channelType == ChType_Motion) {
else if (channelType == ChType_Motion || channelType == ChType_Motion_n) {
iValue = CHANNEL_Get(i);
poststr(request, "<tr><td>");
if (iValue) {
if (iValue == (channelType == ChType_Motion)) {
hprintf255(request, "No motion (ch %i)", i);
}
else {
@ -1828,6 +1828,12 @@ void doHomeAssistantDiscovery(const char* topic, http_request_t* request) {
cJSON_AddStringToObject(dev_info->root, "dev_cla", "motion");
}
break;
case ChType_Motion_n:
{
dev_info = hass_init_binary_sensor_device_info(i, false);
cJSON_AddStringToObject(dev_info->root, "dev_cla", "motion");
}
break;
case ChType_OpenClosed:
{
dev_info = hass_init_binary_sensor_device_info(i, false);