feat: uwzględnienie nieobecności w większej liczbie reguł

This commit is contained in:
2022-05-05 17:20:53 +02:00
parent 23087ce82d
commit 1037c3eec0
2 changed files with 11 additions and 5 deletions

View File

@@ -24,11 +24,13 @@ rule "Zapal cottonballsy i blat przed zmierzchem"
when when
Item sSunset_Event_in_hour received update ON Item sSunset_Event_in_hour received update ON
then then
if (sHolidayVacancy.state == ON) {
return;
}
sOWFS01.sendCommand(ON) sOWFS01.sendCommand(ON)
sOWFS01_expected.postUpdate(ON) sOWFS01_expected.postUpdate(ON)
/* HOLIDAY */
sD1MINI02MOS.sendCommand(ON) sD1MINI02MOS.sendCommand(ON)
end end

View File

@@ -34,7 +34,9 @@ when
Item sSunset_Event_in_hour received update ON Item sSunset_Event_in_hour received update ON
/* Item sSunset_Event_in_twohours received update ON */ /* Item sSunset_Event_in_twohours received update ON */
then then
/* HOLIDAY */ if (sHolidayVacancy.state == ON) {
return;
}
/* drobna przerwa bo cottonballs tez sie zapalaja teraz */ /* drobna przerwa bo cottonballs tez sie zapalaja teraz */
Thread::sleep(1000) Thread::sleep(1000)
@@ -46,7 +48,6 @@ then
end end
/* HOLIDAY */
rule "Zapal lampkę i kanapowe przez zmierzchem gdy pochmurno" rule "Zapal lampkę i kanapowe przez zmierzchem gdy pochmurno"
when when
@@ -54,6 +55,10 @@ when
then then
var Number hours = now.getHourOfDay var Number hours = now.getHourOfDay
if (sHolidayVacancy.state == ON) {
return;
}
/* more than 90% cloud cover && not before 14:00 hour && TODO: only april-october */ /* more than 90% cloud cover && not before 14:00 hour && TODO: only april-october */
if (wClouds.state > 90.0 && hours >= 14 && true) { if (wClouds.state > 90.0 && hours >= 14 && true) {
logInfo("stollampka", "Powyżej 90% chmur, zapalam") logInfo("stollampka", "Powyżej 90% chmur, zapalam")
@@ -70,7 +75,6 @@ end
/* TODO: przerobic na espeasy pulse command. /* TODO: przerobic na espeasy pulse command.
pulse 500ms, thread sleep 1s*/ pulse 500ms, thread sleep 1s*/
/* HOLIDAY */
rule "Zapal lampkę i kanapowe przed zmierzchem" rule "Zapal lampkę i kanapowe przed zmierzchem"
when when