Item- and thing-related rule builders read naturally, for example (omitting dots and parentheses): when item X changed to Y then ...
Time-related builders don't form English sentences:
.when().timeOfDay('17:00').then()
.when().cron('0 0 17 * * ?').then()
.when().dateTime('OutdoorLights_OffTime').timeOnly().then()
.when().dateTime('OutdoorLights_OffDate').then()
Those are logical from the programmer's point of view -- as they map directly to trigger types -- but they read a bit awkwardly IMO.
My proposal is to replace the above with something like:
.when().time().is('17:00').then() or
.when().time().was('17:00').then() or
.when().time().matched('17:00').then()
.when().time().matchedCron('0 0 17 * * ?').then()
.when().time().matchedItem('OutdoorLights_OffTime').then()
.when().timeAndDate().matchedItem('OutdoorLights_OffDate').then()
WDYT?
I'll be happy to create a PR.
Item- and thing-related rule builders read naturally, for example (omitting dots and parentheses):
when item X changed to Y then ...Time-related builders don't form English sentences:
.when().timeOfDay('17:00').then().when().cron('0 0 17 * * ?').then().when().dateTime('OutdoorLights_OffTime').timeOnly().then().when().dateTime('OutdoorLights_OffDate').then()Those are logical from the programmer's point of view -- as they map directly to trigger types -- but they read a bit awkwardly IMO.
My proposal is to replace the above with something like:
.when().time().is('17:00').then()or.when().time().was('17:00').then()or.when().time().matched('17:00').then().when().time().matchedCron('0 0 17 * * ?').then().when().time().matchedItem('OutdoorLights_OffTime').then().when().timeAndDate().matchedItem('OutdoorLights_OffDate').then()WDYT?
I'll be happy to create a PR.