* Fix NPE while deserializing service data JSON objects
* Catch exceptions while handling long poll results
* Correct @type name for user-defined states
* Add unit tests and enhance existing unit tests
Signed-off-by: David Pace <dev@davidpace.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
Adds support for Bosch Smart Water Alarm devices.
* add new thing type and new channel types
* add new services for water detector
* refactor CameraNotificationState and PrivacyModeState to a common enum
EnabledDisabledState that can be re-used in the water detector tilt
service states
* implement handler for new device
* register new device in handler factory and discovery
* add unit tests
* add documentation
Signed-off-by: David Pace <dev@davidpace.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
* Provide unit hints for humidity channel types
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Provide unit hints for noise/volume channel types
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
---------
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
Boosts the unit test coverage for the `boschshc` binding in `src/main/java` to 94%.
Signed-off-by: David Pace <dev@davidpace.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
* [boschshc] Add support for Shutter Control II (#14562)
* add new channel type for child protection
Signed-off-by: David Pace <dev@davidpace.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
* [boschshc] add command to list Bosch Smart Home Controller devices and mapping to openhab devices and related services
Signed-off-by: Gerd Zanker <gerd.zanker@web.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
wrong references were introduced during copy & paste from the previous
thing type definition
Signed-off-by: David Pace <dev@davidpace.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
* [boschshc] Support for Universal Switch I + II
- add thing type and channel type definitions
- re-generate i18n file
- add constants
- add model classes and enums
- implement service and handlers
- register handlers in factory
- register devices in discovery
closes#16244
Signed-off-by: David Pace <dev@davidpace.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
* [boschshc] Cache mDNS-based bridge discovery results
The bridge discovery participant receives lots of mDNS events.
Previously, all events that contained IP addresses of potential bridges
were actively contacted using HTTP requests. On some systems eventually
the long polling stops due to too many requests.
With this change, we
* only consider mDNS events where the name property starts with "Bosch
SHC"
* cache already discovered bridges so we don't have to contact them over
and over again
* make sure that this happens in a thread-safe manner because the mDNS
events are handled in individual concurrently running threads
Signed-off-by: David Pace <dev@davidpace.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
If the long poll response from the Smart Home Controller does not
contain valid JSON, the subscription is gracefully terminated a new one
is initiated after 15 seconds.
closes#15912
Signed-off-by: David Pace <dev@davidpace.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
* [boschshc] Fix options for channels with Switch items
Previously, the option values partially contained Bosch-specific states
instead of the openHAB-specific states ON and OFF.
The option values were fixed and the descriptions were
enhanced/shortened since the UI only provides little space for the state
descriptions.
Signed-off-by: David Pace <dev@davidpace.de>
* [boschshc] Support for Door/Window Sensor II
* add new thing type for Door/Window Sensor II
* add channel types for bypass state and communication quality
* add handler extending the basic Door/Window Sensor handler
* add service implementations
* register handler in discovery service
* add unit tests
* re-generate i18n properties file
* add documentation
closes#15954
Signed-off-by: David Pace <dev@davidpace.de>
* [boschshc] Add support for motion detector illuminance sensor
- add channel and corresponding channel type
- add update description
- add state model
- implement service and handler
- add documentation
- add unit test
---------
Signed-off-by: David Pace <dev@davidpace.de>
* [boschshc] Update active profile of intrusion detection system
Fixes an issue that caused the active configuration profile of the
intrusion detection system not to be updated.
closes#15848
* [boschshc] add channel to control state service registration
Signed-off-by: David Pace <dev@davidpace.de>
* replace call to deprecated HSBType::getRGB() with
ColorUtil::hsbTosRgb()
* make constructors of abstract classes protected
* use instanceof with pattern matching (JEP 305)
* enhance switches with combined cases using comma-separated case
expressions
* remove unnecessary public modifiers in unit tests
Signed-off-by: David Pace <dev@davidpace.de>
- Add new channel definition for silent mode
- Implement silent mode service
- Add unit tests
- Add documentation
- Fix some minor documentation issues
Closes#14779
Signed-off-by: David Pace <dev@davidpace.de>
- fix door/window contact device model (SWD instead of WRC2)
- fix in-wall light switch device model (BSM instead of PSM)
- fix thing type of BWTH (should be a wall thermostat, not a thermostat)
- add association for PSM (smart plug)
- add association for LEDVANCE_LIGHT (smart light bulb)
- add association for TRV (thermostat)
Closes#14672
Signed-off-by: David Pace <dev@davidpace.de>
* [boschshc] Code Enhancements
This commit fixes several compiler warnings as well as several
Checkstyle, FindBugs, PMD and Sonar issues.
* instantiate loggers consistently
* add missing logger calls
* add chained exceptions to logger calls
* provide central Gson instance that does not serialize or deserialize
loggers
* avoid catching NullPointerExceptions
* extract methods where cyclomatic complexity was too high
* remove unnecessary null check in combination with instanceof
* rename local variables that shadow fields
* add missing @NonNull and @Nullable annotations
Signed-off-by: David Pace <dev@davidpace.de>
* #14195 Bridge and Device Discovery
Bridge discovery is implemented via mDNS, local IP addresses are checked.
If a GET returns the public SHC information,
then this shcIpAddress is reported as a discovered bridge.
Devices are always discovered after successful pairing, but a manual scan is also possible.
Added unit tests for Bridge and Device Discovery.
Signed-off-by: Gerd Zanker <gerd.zanker@web.de>