openhab-scripters / openhab-helper-libraries

Scripts and modules for use with openHAB
Eclipse Public License 1.0
88 stars 69 forks source link

[Area Triggers and Actions] light_action throws exceptions #325

Closed theiding closed 3 years ago

theiding commented 4 years ago

light_action throws exceptions in two cases: 1) When a lux item is configured, but the lux item returns NULL an AttributeError is thrown 2) When no "low_lux_trigger" is configured on the item or area_triggers_and_actions_dict level then a KeyError is thrown

Desired behavior: For 1) When a lux item returns NULL, no AttributeError should be logged and the reading should be treated as if it reported a lux level below the lux threshold. A warning should be logged that the lux item reported NULL. For 2) When no "low_lux_trigger" is configured no KeyError should be logged and low_lux_trigger should default to infinity (i.e. all lux readings would be considered to be below the threshold). If lux_item_name is configured a warning should be logged that a lux item is configured without a low_lux_trigger.

theiding commented 4 years ago

Fix is of course trivial and I have the code available. Happy to submit the PR.

5iver commented 3 years ago

1 and 2 are both resolved in #361.