Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alarmClock: Uninitialized hour/minutes Items are uncaught #9

Closed
florian-h05 opened this issue May 16, 2022 · 0 comments · Fixed by #10
Closed

alarmClock: Uninitialized hour/minutes Items are uncaught #9

florian-h05 opened this issue May 16, 2022 · 0 comments · Fixed by #10
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@florian-h05
Copy link
Owner

When the hour or minute Item is unitialized, getClockRule() generates a cron expression like 0 NaN NaN ? * MON *, which leads to openHAB errors.

To avoid that, hour and minute must be checked for NaN.
getClockRule() may initialize hour/minute with a default value as the user cannot set those values in the openHAB iOS app or MainUI and needs either an Android device or the REST API in that case.

@florian-h05 florian-h05 added bug Something isn't working enhancement New feature or request labels May 16, 2022
@florian-h05 florian-h05 self-assigned this May 16, 2022
florian-h05 added a commit that referenced this issue May 16, 2022
* Fixes #9 where uninitialised hour/minute Items were parsed as NaN in the cron expression and led to errors in openhab-core.
* Initialises hour/minute in case their are NaN with default value.
* Additional refactorings were made.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant