thermferm/thermferm.c

changeset 532
34bf9f389749
parent 531
2e42fdf59019
child 533
49580ca85ab7
equal deleted inserted replaced
531:2e42fdf59019 532:34bf9f389749
1570 1570
1571 /* 1571 /*
1572 * Interior lights 1572 * Interior lights
1573 */ 1573 */
1574 if (unit->light_address) { 1574 if (unit->light_address) {
1575 if (unit->door_state && unit->light_state) { 1575 if (unit->door_state && (unit->mode == UNITMODE_NONE) && unit->light_state) {
1576 if (unit->light_wait > 0) { 1576 if (unit->light_wait > 0) {
1577 unit->light_wait--; 1577 unit->light_wait--;
1578 } else { 1578 } else {
1579 unit->light_state = 0; 1579 unit->light_state = 0;
1580 syslog(LOG_NOTICE, "Unit `%s' lights On => Off", unit->name); 1580 syslog(LOG_NOTICE, "Unit `%s' lights On => Off", unit->name);
1581 unit->mqtt_flag |= MQTT_FLAG_DATA; 1581 unit->mqtt_flag |= MQTT_FLAG_DATA;
1582 } 1582 }
1583 } 1583 }
1584 if (!unit->door_state && !unit->light_state) { 1584 if ((!unit->door_state || (unit->mode != UNITMODE_NONE)) && !unit->light_state) {
1585 unit->light_wait = unit->light_delay; /* No delay to turn lights on */ 1585 unit->light_wait = unit->light_delay; /* No delay to turn lights on */
1586 unit->light_state = 1; 1586 unit->light_state = 1;
1587 unit->mqtt_flag |= MQTT_FLAG_DATA; 1587 unit->mqtt_flag |= MQTT_FLAG_DATA;
1588 syslog(LOG_NOTICE, "Unit `%s' lights Off => On", unit->name); 1588 syslog(LOG_NOTICE, "Unit `%s' lights Off => On", unit->name);
1589 } 1589 }

mercurial