-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[boschshc] Provide alarm channel for smoke detectors #18194
Conversation
a843afc
to
5f7531c
Compare
Hi, I took this PR code compiled it and used the latest openhab 5.0.0-snapshot runtime from today and started with a new clean setup.
Can you @david-pace make use of it? I have no idea what could be wrong in the new code or in my test setup. |
* add new channel definition for alarm channel in thing-types.xml * add alarm channel to Smoke Detector and Smoke Detector II * add update instruction sets in binding.xml * re-generate i18n properties file * add constant for new channel * implement alarm service * register service package in tests * extend abstract smoke detector handler * add unit tests * add documentation Signed-off-by: David Pace <[email protected]>
* introduce new subclass * move alarm service implementation into new subclass * introduce new abstract test class * move unit tests into abstract test class Signed-off-by: David Pace <[email protected]>
5f7531c
to
1d0b8aa
Compare
Hi @GerdZanker, thanks for your test attempt 👍 At first glance I cannot explain why the exception occurs. Maybe there is currently a bug on the I just rebased on the latest Note that I also introduced a new subclass for the smoke detectors, because in my first version the Twinguard inherited the Let me know if it works with my latest commit, if not I will dig deeper 🔍 |
Good morning @david-pace, I have the same result with your updated code :( Only if I remove the Afterwards I can see item values of the smoke-detector, but a change of the alarm state results in REST request but no alarm - I expected to hear something.
|
Signed-off-by: David Pace <[email protected]>
Signed-off-by: David Pace <[email protected]>
Thanks for your feedback. I think I mitigated the channel update problem after reading the documentation about updating thing types. Only providing the part in In addition, I studied the Bosch Smart Home Local API again and found two new state enum values that I haven't encountered before. Unfortunatley the documentation is incomplete and I have to guess some of the values, but I added the following enum constants now:
Please let me know if the channel issue is solved with my latest version and also if these alarm state values are usable to make some noise 😉 |
With your updated code I get no errors anymore.
I wasn't able to select any of the new AlarmStates, I patched my thing-types.xml and added the missing option. Afterwards I was able to "make noise" with INTRUSION_ALARM_ON_REQUESTED. The other two *_ALARM_ON_REQUESTED states made no noise. With INTRUSION_ALARM_OFF_REQUESTED the noise can be stopped. Do you know if this what we can/should expect from the Bosch SHC API? |
Thanks for the update 👍 OK, the two values Since we have no more information, I suggest to just keep the two working values in the enum and to add them to Thank you very much for testing @GerdZanker ❤️ Is there anything more to do from your perspective or can this PR be considered complete? If you could test one more time with the latest commit that would be great, thank you! |
* remove enum values from AlarmState * add two valid options to alarm channel type definition * adjust unit test * fix abstract test class name * adjust documentation and fix tables Signed-off-by: David Pace <[email protected]>
@david-pace - did you mean to also mark the PR as ready for review? 🙂 |
I wanted to wait for the final confirmation, but actually you can already start reviewing if you want 😎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest code looks good and works well in my test setup.
Signed-off-by: David Pace <[email protected]> Signed-off-by: Christian Koch <[email protected]>
closes #18161