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

LCN binding #108

Closed
crosenbe opened this issue Jan 11, 2015 · 17 comments · Fixed by #7509
Closed

LCN binding #108

crosenbe opened this issue Jan 11, 2015 · 17 comments · Fixed by #7509
Labels
new binding If someone has started to work on a binding. For a new binding PR.

Comments

@crosenbe
Copy link

I will start this binding, help is welcome.

@kaikreuzer kaikreuzer added the new binding If someone has started to work on a binding. For a new binding PR. label Jan 11, 2015
@Blumi
Copy link

Blumi commented Mar 15, 2015

Hey, I'm currently reading into openHAB2 to write an LCN binding as well (haven't started developing yet). Are you still into it?

I'm still figuring out the details, but the big picture of my concept is this:
lcn-openhab

I just don't know yet, how many things, channels, ... etc. I need. Maybe some openHAB pro can give me a kickstart on this? Kai???

@kaikreuzer
Copy link
Member

@Blumi I doubt it makes much sense to start another LCN binding - as far as I know, @crosenbe is actively working on it.

@crosenbe
Copy link
Author

@Blumi i started with this plugin, but within the last weeks i didn't have as much time i would like to spend, i created some parts of code which connects to PCHK and get data from LCN. Next steps are to do a base design and check out if and how discovery could be used.

@Blumi
Copy link

Blumi commented Mar 16, 2015

@crosenbe could you commit your work to your github fork, so I can have a look at it, please?
What do you think of my idea (see image above) to use the XML export of the LCN-PRO project as configuration for the openHAB-binding?
For the discovery - I don't think we will get far with LCN/PCHK. Officially there is no "scanning" of the bus supported. However I found out that you can send an undocumented PCK message on which every busmodule answers with it's ID. But nothing more. AFAIK you cannot scan the bus for specific sensors, actors or displays. Hence my idea to use the LCN-PRO XML.

@crosenbe
Copy link
Author

I could upload the code but it will not work because i started a redesign. I don't know if the export will work but perhaps there are users which do not have LCN-Pro and want to use openHab anyway. I try to find a way to include LCN into openHab with less user configuration as possible. On the bus interface it's possible to fetch every ID to collect the modules, afterwards there are commands to get more informations about these modules, i.e. the firmware release.

The firmware is essential to define the function the module provides, you know v14 use three variables, v17 could use 10. The idea is to define the functions per release in a static way and use the templates after reading of the module firmware.

The attributes which could not read, have to be configured by hand. But that's just an idea how it could be handled, i don't know if it's a practical solution or not.

@myghost77
Copy link

Hi,

I'm also working an a binding for LCN. I've started with the development before I have read this issue :-( .

What is the current status of your binding?

I'm already able to dim my lights :-) . I'm going to implement further features soon ...

Can I find your implementation somewhere?

By the way: It is not important to have an XML-export from LCN-Pro to create the item configuration automatically. I think it is a better approach to configure the LCN items manually. It will be hard to create reasonable names for the items during automatic export.

@Blumi
Copy link

Blumi commented May 4, 2015

But the XML Export contains the item names that you see in LCN-PRO, everything you'll need is in there:

<Module xsi:type="LCN-UPP" firmwareDate="17070A" serialNo="17070A1*****" foundInBus="false" moduleId="10">
<Name>Schlafzimmer</Name>
<Comment/>
<PeripheryList>
<Periphery xsi:type="PerTypeKeyboard_BT4HorBT4R" name="BT4H/R"/>
</PeripheryList>
<PropertyList>
<BeepOn enabled="true">
<KeyPress>true</KeyPress>
<Errors>true</Errors>
</BeepOn>
<StatusMessages enabled="true">
<NotificationMode>local</NotificationMode>
<NotificationDelay>normal</NotificationDelay>
</StatusMessages>
<SendInternalCommandsToBus>true</SendInternalCommandsToBus>
<PowerFailureCausesKeyD8>false</PowerFailureCausesKeyD8>
<PermitKeyLockTableA>false</PermitKeyLockTableA>
<TransponderEnabled>false</TransponderEnabled>
<OutputPorts xsi:type="OutputPortsDefault">
<StatusCommands>
<Output id="1" destTable="D" destKey="1">false</Output>
<Output id="2" destTable="D" destKey="2">false</Output>
<Output id="3" destTable="D" destKey="3">false</Output>
<Output id="4" destTable="D" destKey="4">false</Output>
</StatusCommands>
<Output id="1" mode="dimmer" extra="disabled" charTable="linear">Deckenlampe</Output>
<Output id="2" mode="dimmer" extra="disabled" charTable="linear">Wandlampe</Output>
<Output id="3" mode="switch 1%" extra="disabled" charTable="halogen"/>
<Output id="4" mode="switch 1%" extra="disabled" charTable="halogen"/>
</OutputPorts>
<TPort xsi:type="TPortDefault">
<MakeDetection>long</MakeDetection>
<ContactMode>make</ContactMode>
</TPort>
<IPort xsi:type="IPortNoSensor"/>
<PPort xsi:type="PPortVirtualRelays">
<RelayStatusCommands>
<Relay1-4>false</Relay1-4>
<Relay5-8>false</Relay5-8>
</RelayStatusCommands>
</PPort>
<Keys>
<Table id="A">
<Key id="1" comment="Tür Lichtschalter">
<Fnct id="1" destSeg="0" destType="module" destId="0">
<Command type="hit">Ausg.1: UMschalten, Rampe: 1.00 Sek</Command>
<Command type="make">Ausg.1: UMschalten, Rampe: 4.00 Sek</Command>
<Command type="break">Ausg.1: Rampe stop</Command>
</Fnct>
</Key>
<Key id="2" comment="Tür Doppelwippe li">
<Fnct id="1" destSeg="0" destType="module" destId="6">
<Command type="hit">Relais: - - - - U U - -</Command>
<Command type="make">Relais: - - 1 1 1 0 - -</Command>
<Command type="break">Unprogrammiert</Command>
</Fnct>
<Fnct id="2" destSeg="0" destType="module" destId="0">
<Command type="hit">Unprogrammiert</Command>
<Command type="make">Ausg.1: =100%, Rampe: 30.00 Sek</Command>
<Command type="break">Unprogrammiert</Command>
</Fnct>
</Key>
<Key id="3" comment="Tür Doppelwippe re">
<Fnct id="1" destSeg="0" destType="module" destId="6">
<Command type="hit">Relais: - - U U - - - -</Command>
<Command type="make">Relais: - - 1 0 1 1 - -</Command>
<Command type="break">Unprogrammiert</Command>
</Fnct>
</Key>
<Key id="4" comment="Bett Lichtschalter">
<Fnct id="1" destSeg="0" destType="module" destId="0">
<Command type="hit">Ausg.1: UMschalten, Rampe: 3.00 Sek</Command>
<Command type="make">Sende Tasten: 1 - - - - - - - D=kurz</Command>
<Command type="break">Unprogrammiert</Command>
</Fnct>
</Key>
</Table>
<Table id="B"/>
<Table id="C"/>
<Table id="D">
<Key id="1">
<Fnct id="1" destSeg="0" destType="module" destId="6">
<Command type="hit">Relais: - - 1 0 - - - -</Command>
<Command type="make">Unprogrammiert</Command>
<Command type="break">Unprogrammiert</Command>
</Fnct>
</Key>
</Table>
</Keys>
</PropertyList>
</Module>

@myghost77
Copy link

You are right: In case you have added comments to your LCN-Pro configuration, you will have the possibility to create reasonable names. I do not have that much comments in my LCN-Pro. I will use the openHAB configuration as documentation for my system ;-) . So, the XML-converter would have a very, very low prio on my side ...

First of all I want to have a running binding as soon as possible!

@myghost77
Copy link

So, I have finalized the first version of my binding for LCN !!! You can find it here: https://github.com/myghost77/openHAB
I have also added a very rough documentation ...

In the mean time the manufacturer has also released a binding for LCN :-( . Had I known it earlier, that the manufacturer is working on a binding, I would not have begun. This means that I will not bring my version to the openHAB project, but will use it in my own LCN system @home :-) .

Now I will start to create the item configuration for my binding for my home to see how it behaves in a large, real system ...

@kaikreuzer
Copy link
Member

Hi @myghost77,

Yes, that was also a big surprise to me that Issendorff developed an LCN binding - it would indeed have been much better if they had announced that in advance as many people now spend efforts in vain. Although it is not clear, which implementation is better, this is something only LCN users can judge.

Actually, this issue here is about an LCN binding for openHAB 2 - and if I get you right, your binding is for openHAB 1, right? So we are still lacking an openHAB 2 version. We should discuss together how to proceed best on this. I'm trying to contact Issendorff to see how much they would / want to involve themselves.

Best regards,
Kai

@kaikreuzer
Copy link
Member

FTR: There is now an official openHAB 1 LCN binding that also works on the openHAB 2 runtime (and it is included in the openHAB 2 addon zip).
@Blumi: Are you actively looking into porting it to OH2 or is it good enough and we close this issue for now?

@Blumi
Copy link

Blumi commented Nov 18, 2015

I think this issue can be closed, I'm not porting it anytime soon, sorry.
Maybe the author of the official LCN binding @Issendorff plans on porting it to OH2. I think this depends on the public response and the impact on the commercial sales of the LCN hardware.

@Issendorff
Copy link

I will port it to OH2 in the near future. Still waiting for customer feedback for the current binding though (hope it will be included in the Add-Ons binary package anytime soon).

@kaikreuzer
Copy link
Member

Still waiting for customer feedback for the current binding

openHAB 1.8 will be released on Jan 11 and this is the first release that contains the LCN binding. I will also specifically highlight it in my announcement, so I hope that more people will learn about it, start using it and provide feedback!

@fwolter
Copy link
Member

fwolter commented Apr 1, 2020

I finished porting the LCN binding to OH2. Just mentioned, that nobody else takes effort to port it in the meantime. I'll test it with my busses and send a PR if everything is fine.

@amut41
Copy link

amut41 commented Apr 1, 2020

Cool. I‘d be happy to offer a test on my LCN/openHAB set, if it might be of any help.

@fwolter
Copy link
Member

fwolter commented Apr 1, 2020

Thanks for the response! I'd be happy to have testers as well. Please drop me an email. I will come back to you as soon as I finished some tests and documentation. [email protected]

@kaikreuzer kaikreuzer reopened this Jun 2, 2020
kaikreuzer pushed a commit that referenced this issue Jun 17, 2020
* [lcn] Add LCN binding

Migrates the Local Control Network Binding from OH1 to OH2.

Closes #108

Signed-off-by: Fabian Wolter <[email protected]>
knikhilwiz pushed a commit to knikhilwiz/openhab2-addons that referenced this issue Jul 12, 2020
* [lcn] Add LCN binding

Migrates the Local Control Network Binding from OH1 to OH2.

Closes openhab#108

Signed-off-by: Fabian Wolter <[email protected]>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this issue Jul 26, 2020
* [lcn] Add LCN binding

Migrates the Local Control Network Binding from OH1 to OH2.

Closes openhab#108

Signed-off-by: Fabian Wolter <[email protected]>
Signed-off-by: CSchlipp <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
* [lcn] Add LCN binding

Migrates the Local Control Network Binding from OH1 to OH2.

Closes openhab#108

Signed-off-by: Fabian Wolter <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
* [lcn] Add LCN binding

Migrates the Local Control Network Binding from OH1 to OH2.

Closes openhab#108

Signed-off-by: Fabian Wolter <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
* [lcn] Add LCN binding

Migrates the Local Control Network Binding from OH1 to OH2.

Closes openhab#108

Signed-off-by: Fabian Wolter <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
* [lcn] Add LCN binding

Migrates the Local Control Network Binding from OH1 to OH2.

Closes openhab#108

Signed-off-by: Fabian Wolter <[email protected]>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this issue Sep 1, 2020
* [lcn] Add LCN binding

Migrates the Local Control Network Binding from OH1 to OH2.

Closes openhab#108

Signed-off-by: Fabian Wolter <[email protected]>
Signed-off-by: Daan Meijer <[email protected]>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this issue Sep 19, 2020
* [lcn] Add LCN binding

Migrates the Local Control Network Binding from OH1 to OH2.

Closes openhab#108

Signed-off-by: Fabian Wolter <[email protected]>
fwolter added a commit that referenced this issue Oct 30, 2021
…nal refactoring (#11134)

* Reduce debug output

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added meta information for Bosch binding

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Set binding online only if fetching rooms and devices worked

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Replaced hard-coded IP address with configuration from things file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixes after rebasing on 2.5.x branch

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put keystore where openhab user can access it

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Attempt to get a new subscription ID when the old one is invalidated

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Better install script

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Asynchronously get subscription ID

Otherwise, code would get stuck on requesting second subscription ID
Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Initial steps towards pairing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Doesn't compile because of bouncycastle - compiles if commented out

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Bumped version

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added basic support for multiple devices to support Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Support for power meter in power switches + all values from Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add window contact to the list of supported things

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Updated README to indicate new supported devices

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added missing file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added motion detector thing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* All devices support RefreshType now

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleanup - removed pairing related stuff that doesn't work

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed a weird bug where InWallSwitchHandler was not an instance of SHCHandler

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Update BoschSHCBridgeHandler.java

fixed HTTP request URL to get rooms from SHC

Signed-off-by: Gerd Zanker <[email protected]>

* Add handler for Bosch Shutter Control to get and set its open level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Auto update of .classpath by IDE

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle PercentType command to set a specific shutter level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put service name in constant instead of using it hard coded twice

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Refactor putState method of BoschSHCBridgeHandler

Remove unnecessary parts of the request like Gateway ID and put some general logic into separate methods to reuse them in other functions later

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Send operation state STOPPED to stop shutter from moving

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add shutter control to supported devices in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add null reference check to avoid a NullReferenceException in ShutterControlHandler if device state couldn't be fetched

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add TemperatureLevelService

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add ThermostatHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add valve tappet position channel to thermostat via ValveTappet service

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add service registration for BoschSHCHandler, so the state updates are automatically calling the registered state update callback of the handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add affectedChannels to service registration and handle RefreshType directly in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleaned up DeviceStatusUpdate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added Bosch SHC certs

added public certificates from https://github.com/BoschSmartHome/bosch-shc-api-docs/tree/master/best_practice

Signed-off-by: Gerd Zanker <[email protected]>

* added pairing support

added support for keystore creation and pairing
documented the process in readme
refactoring of httpClient to take care of SSL context

Signed-off-by: Gerd Zanker <[email protected]>

* Add RoomClimateControlService and ClimateControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle command to set setpoint temperature and move conversion from service state data to thing states into service state classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove unnecessary imports from ThermostatHandler.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make new service and handler @NonNullByDefault

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added comments for climate control service, handler and base service and handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add missing comments on new classes and their methods

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make registerService method of BoschSHCHandler private and adjust usages

Derived handlers should use createService instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw an error instead of returning null for method getBridgeHandler of BoschSHCHandler

This allows for fewer null checks after the initialization of a handler.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @author tags in JavaDoc of new classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Ran mvn spotless:apply to apply correct code formatting

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed missing imports in BoschSHCService.java

This was caused by a too quick merge of me.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed warnings about null annotations

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to all handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added license header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* #16 Adjust logger usages to not be too verbose

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #10 Remove obsolete parse-things.py script

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #29 Remove dev scripts install.sh and run.sh scripts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added author name to each class comment

Added the author(s) and small comment to each class based on the git
history and if necessary created the basis class comment body.

Signed-off-by: Gerd Zanker <[email protected]>

* added license header for new files

Signed-off-by: Gerd Zanker <[email protected]>

* run mvn spotless check/apply

Signed-off-by: Gerd Zanker <[email protected]>

* #24 Catch error response when trying to get state of a service of a device and throw specific error instead of returning invalid state object

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #24 Run mvn spotless:apply and mvn license:format to respect coding guidelines

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #5 Update README.md with up-to-date information about the setup of the binding

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #31 Typo in README.md

Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add detailed description of the system password to provide in README.md

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix non-initialized member of @NonNullByDefault class ValveTappetServiceState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #7 Moved each device to a separate subfolder inside devices folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #44 Adjust version of org.openhab.addons.reactor.bundles to 2.5.9-SNAPSHOT in pom.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #45 Increase year in copyright headers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #45 Remove several obsolete loggers and fix logging of exceptions

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #45 Fixed some code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #45 Ran mvn spotless:apply

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #45 Revert adding @NonNullByDefault to BoschSHCConfiguration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #47 Fixed code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* updated text files based on pull request feedback

Signed-off-by: Gerd Zanker <[email protected]>

* Apply suggestions from code review

Applied only suggested string text changes and few trivial code changes

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Improved comments and changed visibility

code review findings improved related to code comments
and public/private visibility of variables
removed example properties file and class path entries

Signed-off-by: Gerd Zanker <[email protected]>

* added @NonNullByDefault annotation where necessary and easy possible

in addition minor improvements like
removed TODO for code refactoring
used BoschSHCException instead of Error in one place
Renamed internal Error class to ErroInfo
ran spotless:apply

Signed-off-by: Gerd Zanker <[email protected]>

* use SIUnits

replaced all Celcius units with eclipse SIUnits

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* change logging and GSON related code

increased many log levels
avoid creating new GSON instances in derived handler subclasses
changed catch code to avoid stack trace dumps

Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to BoschSHCConfiguration class and remove obsolete usages of configuration in handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw BoschSHCExceptions instead of generic Errors and handle them during creation of services

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Class::new supplier function instead of deprecated Class.newInstance() method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove @NonNullByDefault from inner classes and unused logger member to remove compile warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Base64.getEncoder().encodeToString instead of Base64.getEncoder().encode and a manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault annotation to BoschSHCBridgeConfiguration and check for empty password and ip address in configuration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use try-with-resources to auto-close streams for key store creation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move data transfer objects of bridge into dto folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add thing type ids and channel type ids to README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move thing configurations out of thing-types.xml and into configs.xml. Remove deprecated required element and use attribute instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Adjust some elements, units, descriptions and labels in configs.xml and thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move url and request creation from BoschSHCBridgeHandler to BoschHttpClient to reuse it inside BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add default timeout to request to smart home controller

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make httpClient of BoschSHCBridgeHandler @nullable and use BoschHttpClient createUrl and createRequest methods where possible

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make gson field in BoschSHCBridgeHandler final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Simplify getDevices method of BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use getContentAsString() instead of getContent() plus manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use instanceof instead of isInstance(...) in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add registerService method to BoschSHCHandler to register already created services, so they can be created in the constructor of a handler and do not have to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using simpler String.format instead of MessageFormatter in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move ShutterControlState into dto subfolder and remove @NonNullByDefault annotation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make bridgeHandler and deviceId in BoschSHCService @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move DTOs in dto subfolders and remove @NonNullByDefault annotations from them

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add texts for errors during initialization of bridge

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Migrate PowerSwitch to new service architecture to get rid of BoschSHCBridgeHandler.updateSwitchState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete null parameter from subscription request

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Removed obsolete TODO about hard-coded data which does not exist anymore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use lambda for response handling of long poll

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete @nonnull annotations in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw http exceptions when trying to request state from a device to set the thing to offline

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add state options for combined-rating, temperature-rating and humidity-rating channels

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix several minor static code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added migration artifacts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix formatting and increase version number

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fix HTTP client issue, improve connection logging, add Developers markdown

the HTTPClient requests were broken
updated exception handling and logging for connection and pairing
describing source of certificates

Signed-off-by: Gerd Zanker <[email protected]>

* Use service for shutter control handling instead of having the logic inside the ShutterControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #47 Fix code formatting to remove code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed pairing

Signed-off-by: Gerd Zanker <[email protected]>

* Fixed long poll

Signed-off-by: Gerd Zanker <[email protected]>

* Move common error handling for parsing responses from BoschHttpClient into sendRequest method to make subscribe request logic clearer

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use scheduler.schedule instead of Thread.sleep during long polling

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using synchronous request for subscribe request

The initialization is not finished without a successful subscription.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use synchronous long poll request to get it to work

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling asynchronous to not block scheduler threads

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Only scheduling new long polls while bridge is not disposed and aborting long polling on disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move long polling logic into separate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling requests synchronous again, the asynchronous way still does not receive any state updates

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* replaced while loop for pairing with scheduler calls

Pattern from LongPolling reused.
Scheduling new initial access checks including pairing every 15 seconds until it was successful and long polling can be started

Signed-off-by: Gerd Zanker <[email protected]>

* #47 Throw BoschSHCException instead of raw error to avoid code analysis warning

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #47 Remove TODO from code and add issue #55 instead

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #47 Pass non-null httpClient to bridge initialization instead of having to check for null reference

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Use one supportsThingTypes mapping to list the supported things with their handler in BoschSHCHandlerFactory

Previously an array plus a big switch was required.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #47 Starting http client before scheduling initial access

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use logger.debug instead of logger.info

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Include cause exception in the PairingFailedException

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Move fields above constructor in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Remove obsolete configuration field from BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Move fields and constructor in JsonRpcRequest to top of the class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Log the failure of a long poll as warning instead of error

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Use %s instead of {} as placeholder for String.format

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Move @nullable annotation in front of field name

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Specify UTF_8 as charset to convert string to byte array

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Remove spaces from pem files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Change ArrayList to List in Device.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Use QuantityType for power and energy consumption of the in-wall switch handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Check if StopMoveType is STOP in ShutterControlHandler before setting the device state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Make fields of DeviceService final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Stop http client and cancel scheduled pairing on bridge disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Remove channel check in BoschTwinguardHandler for Refresh command

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Add exception message to warning when update in BoschTwinguardHandler and WindowContactHandler returns incorrect state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Add additional information about channels to thing-types.xml and README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Remove confusing comment from LongPolling.subscribe method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Removed obsolete error log in LongPolling.subscribe

A warning is already logged in BoschBridgeHandler when an exception occurs

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Add detailed description for purity channel

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Fix typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Change scheduledPairing field in BoschSHCBridgeHandler to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Change type of channel values from DecimalType to QuantityType in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Remove obsolete .classpath and .project files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Fixed typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Only log error message instead of whole stack trace in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Remove exception which is not thrown and typo in BoschSslUtil

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Use SmartHomeUnits instead of AbstractUnit in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Added supported-bridge-type-refs to thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Remove invalid whitespace from thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Fixed warnings and errors caused by updated Gson library

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Update info about auto reload of bundle jar in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Update information about adding items and things via UI, added missing password configuration value and changed headline in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Execute long polling requests asynchronous to not block a thread

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Refactored WindowContactHandler to use ShutterContactService instead of implementing service logic itself

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Remove obsolete .gitignore. The ignored files are already ignored by the root .gitignore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Rename constant supportsThingTypes to SUPPORTED_THING_TYPES in BoschSHCHandlerFactory

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Use List.of instead of Arrays.asList

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Call super.dispose last in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Add exception message to status when http connection to controller fails

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Handle JsonSyntaxException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Forward InterruptedExceptions to callers, so they have to be handled correctly

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Logging long poll error message and code instead of hash

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Throwing InterruptedException during pairing instead of only logging it

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Move nested class AbortLongPolling to end of LongPolling class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Make gson instance static final in BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Rename gson to GSON and make it static final in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Remove @nullable annotations from GSON-created objects

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Add causing exception to ExecutionException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* #14 Add JsonSyntaxException to definition of processUpdate in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fixed keyStore creation

Moved PEM files into expected folder according to package

Signed-off-by: Gerd Zanker <[email protected]>

* moved final fields above non-final fields

Signed-off-by: Gerd Zanker <[email protected]>

* updated copyright year in header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* fixed last two pending warnings

added back the removed @nullable annotation in sendRequest()
replaced deprecated SslContextFactory constructor call

Signed-off-by: Gerd Zanker <[email protected]>

* added Bouncy Castle third-party license info into NOTICE

Signed-off-by: Gerd Zanker <[email protected]>

* changed Bouncy Castle version to same version as  currently used in org.openhab.core.io.jetty.certificate to later reduce download size

Signed-off-by: Gerd Zanker <[email protected]>

* #62 Correctly check if long poll response is valid

GSON will not return null if there is no "result" field, but will just set the "result" member to null.

Signed-off-by: Christian Oeing <[email protected]>

* Add @NonNullByDefault annotation to LongPollResultTest class and fix method name

Signed-off-by: Christian Oeing <[email protected]>

* added first unittests for BoschSslUtil class

Signed-off-by: Gerd Zanker <[email protected]>

* added next unittests for BoschHttpClient class

Signed-off-by: Gerd Zanker <[email protected]>

* #55 replaced the password with a fixed one

The changeable SHC system password for the keystore is replaced by a static string in the code.
The keyStore name is now based on SHC ipAddress to support multiple SmartHomeControllers.

Signed-off-by: Gerd Zanker <[email protected]>

* #72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* #77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* #62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* #62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* #74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* #74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* #76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* #76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* #78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* #75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* #72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* #77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* #62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* #62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* #74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* #74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* #76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* #76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* #78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* #75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* added newline

Signed-off-by: Gerd Zanker <[email protected]>

* #46 Rename BoschInWallSwitchHandler, BoschTwinguardHandler, BoschSHCBridgeConfiguration and BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>

* #46 Adjust descriptions of things

Signed-off-by: Christian Oeing <[email protected]>

* #40 Use LatestMotionService in MotionDetectorHandler

Signed-off-by: Christian Oeing <[email protected]>

* #40 Use service instead of custom logic in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>

* #40 Add PowerMeterService to use in InWallSwitchHandler instead of having the logic directly in the handler

Signed-off-by: Christian Oeing <[email protected]>

* #40 Rename InWallSwitchHandler to LightControlHandler

This is the official name in the Bosch API documentation, so we should use it as well (https://apidocs.bosch-smarthome.com/local)

Signed-off-by: Christian Oeing <[email protected]>

* #34 Get device info on thing initialization to check if device exists

Signed-off-by: Christian Oeing <[email protected]>

* #34 Use generic sendRequest method of http client to have consistent error handling

Signed-off-by: Christian Oeing <[email protected]>

* #34 Fix formatting error when logging device info

Signed-off-by: Christian Oeing <[email protected]>

* #83 Add info if a channel is writable to README.md

Signed-off-by: Christian Oeing <[email protected]>

* #84 Adjust/Add descriptions of supported devices

Signed-off-by: Christian Oeing <[email protected]>

* #25 Add humidity level service and wall thermostat handler

Signed-off-by: Christian Oeing <[email protected]>

* #25 Add wall thermostat handler to handler factory

Signed-off-by: Christian Oeing <[email protected]>

* #66 Check type of service state when received by bridge to make sure that it has the expected type

Signed-off-by: Christian Oeing <[email protected]>

* #41 Add child lock service to Thermostat handler and link its state to a "child-lock" channel

Signed-off-by: Christian Oeing <[email protected]>

* Add null check in BoschSHCServiceState.isValid

Signed-off-by: Christian Oeing <[email protected]>

* #41 Use custom channel type for child-lock. Handle setting child lock state.

Signed-off-by: Christian Oeing <[email protected]>

* #101 Store expected state type inside a member instead of a static variable

The static variable was stored in the base class, so it was only initialized once even for different state types

Signed-off-by: Christian Oeing <[email protected]>

* #63 Use better identifier for thing that is missing a (valid) bridge

Signed-off-by: Christian Oeing <[email protected]>

* #108 Add changelog to README.md

Signed-off-by: Christian Oeing <[email protected]>

* #109 Catch possible null pointer exception in long poll response handling

Signed-off-by: Christian Oeing <[email protected]>

* Fix potential null pointer access

Signed-off-by: Christian Oeing <[email protected]>

* Fix static code analysis error and 2 warnings

Signed-off-by: Christian Oeing <[email protected]>

* #111 Remove changelog from README.md

Signed-off-by: Christian Oeing <[email protected]>

* #112 Remove JSON from logs

Signed-off-by: Christian Oeing <[email protected]>

Co-authored-by: Stefan Kaestle <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Co-authored-by: Christian Oeing <[email protected]>
Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
dschoepel pushed a commit to dschoepel/openhab-addons that referenced this issue Nov 9, 2021
…nal refactoring (openhab#11134)

* Reduce debug output

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added meta information for Bosch binding

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Set binding online only if fetching rooms and devices worked

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Replaced hard-coded IP address with configuration from things file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixes after rebasing on 2.5.x branch

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put keystore where openhab user can access it

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Attempt to get a new subscription ID when the old one is invalidated

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Better install script

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Asynchronously get subscription ID

Otherwise, code would get stuck on requesting second subscription ID
Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Initial steps towards pairing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Doesn't compile because of bouncycastle - compiles if commented out

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Bumped version

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added basic support for multiple devices to support Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Support for power meter in power switches + all values from Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add window contact to the list of supported things

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Updated README to indicate new supported devices

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added missing file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added motion detector thing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* All devices support RefreshType now

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleanup - removed pairing related stuff that doesn't work

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed a weird bug where InWallSwitchHandler was not an instance of SHCHandler

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Update BoschSHCBridgeHandler.java

fixed HTTP request URL to get rooms from SHC

Signed-off-by: Gerd Zanker <[email protected]>

* Add handler for Bosch Shutter Control to get and set its open level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Auto update of .classpath by IDE

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle PercentType command to set a specific shutter level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put service name in constant instead of using it hard coded twice

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Refactor putState method of BoschSHCBridgeHandler

Remove unnecessary parts of the request like Gateway ID and put some general logic into separate methods to reuse them in other functions later

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Send operation state STOPPED to stop shutter from moving

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add shutter control to supported devices in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add null reference check to avoid a NullReferenceException in ShutterControlHandler if device state couldn't be fetched

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add TemperatureLevelService

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add ThermostatHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add valve tappet position channel to thermostat via ValveTappet service

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add service registration for BoschSHCHandler, so the state updates are automatically calling the registered state update callback of the handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add affectedChannels to service registration and handle RefreshType directly in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleaned up DeviceStatusUpdate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added Bosch SHC certs

added public certificates from https://github.com/BoschSmartHome/bosch-shc-api-docs/tree/master/best_practice

Signed-off-by: Gerd Zanker <[email protected]>

* added pairing support

added support for keystore creation and pairing
documented the process in readme
refactoring of httpClient to take care of SSL context

Signed-off-by: Gerd Zanker <[email protected]>

* Add RoomClimateControlService and ClimateControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle command to set setpoint temperature and move conversion from service state data to thing states into service state classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove unnecessary imports from ThermostatHandler.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make new service and handler @NonNullByDefault

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added comments for climate control service, handler and base service and handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add missing comments on new classes and their methods

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make registerService method of BoschSHCHandler private and adjust usages

Derived handlers should use createService instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw an error instead of returning null for method getBridgeHandler of BoschSHCHandler

This allows for fewer null checks after the initialization of a handler.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @author tags in JavaDoc of new classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Ran mvn spotless:apply to apply correct code formatting

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed missing imports in BoschSHCService.java

This was caused by a too quick merge of me.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed warnings about null annotations

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to all handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added license header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#16 Adjust logger usages to not be too verbose

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#10 Remove obsolete parse-things.py script

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#29 Remove dev scripts install.sh and run.sh scripts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added author name to each class comment

Added the author(s) and small comment to each class based on the git
history and if necessary created the basis class comment body.

Signed-off-by: Gerd Zanker <[email protected]>

* added license header for new files

Signed-off-by: Gerd Zanker <[email protected]>

* run mvn spotless check/apply

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#24 Catch error response when trying to get state of a service of a device and throw specific error instead of returning invalid state object

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#24 Run mvn spotless:apply and mvn license:format to respect coding guidelines

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#5 Update README.md with up-to-date information about the setup of the binding

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#31 Typo in README.md

Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add detailed description of the system password to provide in README.md

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix non-initialized member of @NonNullByDefault class ValveTappetServiceState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#7 Moved each device to a separate subfolder inside devices folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#44 Adjust version of org.openhab.addons.reactor.bundles to 2.5.9-SNAPSHOT in pom.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Increase year in copyright headers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Remove several obsolete loggers and fix logging of exceptions

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Fixed some code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Ran mvn spotless:apply

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Revert adding @NonNullByDefault to BoschSHCConfiguration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Fixed code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* updated text files based on pull request feedback

Signed-off-by: Gerd Zanker <[email protected]>

* Apply suggestions from code review

Applied only suggested string text changes and few trivial code changes

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Improved comments and changed visibility

code review findings improved related to code comments
and public/private visibility of variables
removed example properties file and class path entries

Signed-off-by: Gerd Zanker <[email protected]>

* added @NonNullByDefault annotation where necessary and easy possible

in addition minor improvements like
removed TODO for code refactoring
used BoschSHCException instead of Error in one place
Renamed internal Error class to ErroInfo
ran spotless:apply

Signed-off-by: Gerd Zanker <[email protected]>

* use SIUnits

replaced all Celcius units with eclipse SIUnits

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* change logging and GSON related code

increased many log levels
avoid creating new GSON instances in derived handler subclasses
changed catch code to avoid stack trace dumps

Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to BoschSHCConfiguration class and remove obsolete usages of configuration in handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw BoschSHCExceptions instead of generic Errors and handle them during creation of services

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Class::new supplier function instead of deprecated Class.newInstance() method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove @NonNullByDefault from inner classes and unused logger member to remove compile warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Base64.getEncoder().encodeToString instead of Base64.getEncoder().encode and a manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault annotation to BoschSHCBridgeConfiguration and check for empty password and ip address in configuration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use try-with-resources to auto-close streams for key store creation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move data transfer objects of bridge into dto folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add thing type ids and channel type ids to README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move thing configurations out of thing-types.xml and into configs.xml. Remove deprecated required element and use attribute instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Adjust some elements, units, descriptions and labels in configs.xml and thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move url and request creation from BoschSHCBridgeHandler to BoschHttpClient to reuse it inside BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add default timeout to request to smart home controller

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make httpClient of BoschSHCBridgeHandler @nullable and use BoschHttpClient createUrl and createRequest methods where possible

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make gson field in BoschSHCBridgeHandler final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Simplify getDevices method of BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use getContentAsString() instead of getContent() plus manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use instanceof instead of isInstance(...) in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add registerService method to BoschSHCHandler to register already created services, so they can be created in the constructor of a handler and do not have to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using simpler String.format instead of MessageFormatter in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move ShutterControlState into dto subfolder and remove @NonNullByDefault annotation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make bridgeHandler and deviceId in BoschSHCService @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move DTOs in dto subfolders and remove @NonNullByDefault annotations from them

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add texts for errors during initialization of bridge

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Migrate PowerSwitch to new service architecture to get rid of BoschSHCBridgeHandler.updateSwitchState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete null parameter from subscription request

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Removed obsolete TODO about hard-coded data which does not exist anymore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use lambda for response handling of long poll

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete @nonnull annotations in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw http exceptions when trying to request state from a device to set the thing to offline

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add state options for combined-rating, temperature-rating and humidity-rating channels

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix several minor static code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added migration artifacts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix formatting and increase version number

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fix HTTP client issue, improve connection logging, add Developers markdown

the HTTPClient requests were broken
updated exception handling and logging for connection and pairing
describing source of certificates

Signed-off-by: Gerd Zanker <[email protected]>

* Use service for shutter control handling instead of having the logic inside the ShutterControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Fix code formatting to remove code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed pairing

Signed-off-by: Gerd Zanker <[email protected]>

* Fixed long poll

Signed-off-by: Gerd Zanker <[email protected]>

* Move common error handling for parsing responses from BoschHttpClient into sendRequest method to make subscribe request logic clearer

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use scheduler.schedule instead of Thread.sleep during long polling

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using synchronous request for subscribe request

The initialization is not finished without a successful subscription.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use synchronous long poll request to get it to work

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling asynchronous to not block scheduler threads

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Only scheduling new long polls while bridge is not disposed and aborting long polling on disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move long polling logic into separate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling requests synchronous again, the asynchronous way still does not receive any state updates

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* replaced while loop for pairing with scheduler calls

Pattern from LongPolling reused.
Scheduling new initial access checks including pairing every 15 seconds until it was successful and long polling can be started

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Throw BoschSHCException instead of raw error to avoid code analysis warning

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Remove TODO from code and add issue openhab#55 instead

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Pass non-null httpClient to bridge initialization instead of having to check for null reference

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use one supportsThingTypes mapping to list the supported things with their handler in BoschSHCHandlerFactory

Previously an array plus a big switch was required.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Starting http client before scheduling initial access

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use logger.debug instead of logger.info

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Include cause exception in the PairingFailedException

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move fields above constructor in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete configuration field from BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move fields and constructor in JsonRpcRequest to top of the class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Log the failure of a long poll as warning instead of error

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use %s instead of {} as placeholder for String.format

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move @nullable annotation in front of field name

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Specify UTF_8 as charset to convert string to byte array

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove spaces from pem files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change ArrayList to List in Device.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use QuantityType for power and energy consumption of the in-wall switch handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Check if StopMoveType is STOP in ShutterControlHandler before setting the device state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Make fields of DeviceService final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Stop http client and cancel scheduled pairing on bridge disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove channel check in BoschTwinguardHandler for Refresh command

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add exception message to warning when update in BoschTwinguardHandler and WindowContactHandler returns incorrect state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add additional information about channels to thing-types.xml and README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove confusing comment from LongPolling.subscribe method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Removed obsolete error log in LongPolling.subscribe

A warning is already logged in BoschBridgeHandler when an exception occurs

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add detailed description for purity channel

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fix typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change scheduledPairing field in BoschSHCBridgeHandler to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change type of channel values from DecimalType to QuantityType in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete .classpath and .project files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fixed typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Only log error message instead of whole stack trace in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove exception which is not thrown and typo in BoschSslUtil

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use SmartHomeUnits instead of AbstractUnit in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Added supported-bridge-type-refs to thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove invalid whitespace from thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fixed warnings and errors caused by updated Gson library

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Update info about auto reload of bundle jar in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Update information about adding items and things via UI, added missing password configuration value and changed headline in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Execute long polling requests asynchronous to not block a thread

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Refactored WindowContactHandler to use ShutterContactService instead of implementing service logic itself

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete .gitignore. The ignored files are already ignored by the root .gitignore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Rename constant supportsThingTypes to SUPPORTED_THING_TYPES in BoschSHCHandlerFactory

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use List.of instead of Arrays.asList

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Call super.dispose last in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add exception message to status when http connection to controller fails

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Handle JsonSyntaxException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Forward InterruptedExceptions to callers, so they have to be handled correctly

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Logging long poll error message and code instead of hash

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Throwing InterruptedException during pairing instead of only logging it

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move nested class AbortLongPolling to end of LongPolling class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Make gson instance static final in BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Rename gson to GSON and make it static final in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove @nullable annotations from GSON-created objects

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add causing exception to ExecutionException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add JsonSyntaxException to definition of processUpdate in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fixed keyStore creation

Moved PEM files into expected folder according to package

Signed-off-by: Gerd Zanker <[email protected]>

* moved final fields above non-final fields

Signed-off-by: Gerd Zanker <[email protected]>

* updated copyright year in header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* fixed last two pending warnings

added back the removed @nullable annotation in sendRequest()
replaced deprecated SslContextFactory constructor call

Signed-off-by: Gerd Zanker <[email protected]>

* added Bouncy Castle third-party license info into NOTICE

Signed-off-by: Gerd Zanker <[email protected]>

* changed Bouncy Castle version to same version as  currently used in org.openhab.core.io.jetty.certificate to later reduce download size

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Correctly check if long poll response is valid

GSON will not return null if there is no "result" field, but will just set the "result" member to null.

Signed-off-by: Christian Oeing <[email protected]>

* Add @NonNullByDefault annotation to LongPollResultTest class and fix method name

Signed-off-by: Christian Oeing <[email protected]>

* added first unittests for BoschSslUtil class

Signed-off-by: Gerd Zanker <[email protected]>

* added next unittests for BoschHttpClient class

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#55 replaced the password with a fixed one

The changeable SHC system password for the keystore is replaced by a static string in the code.
The keyStore name is now based on SHC ipAddress to support multiple SmartHomeControllers.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* openhab#62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* openhab#76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* openhab#78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* openhab#62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* openhab#76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* openhab#78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* added newline

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#46 Rename BoschInWallSwitchHandler, BoschTwinguardHandler, BoschSHCBridgeConfiguration and BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#46 Adjust descriptions of things

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Use LatestMotionService in MotionDetectorHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Use service instead of custom logic in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Add PowerMeterService to use in InWallSwitchHandler instead of having the logic directly in the handler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Rename InWallSwitchHandler to LightControlHandler

This is the official name in the Bosch API documentation, so we should use it as well (https://apidocs.bosch-smarthome.com/local)

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Get device info on thing initialization to check if device exists

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Use generic sendRequest method of http client to have consistent error handling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Fix formatting error when logging device info

Signed-off-by: Christian Oeing <[email protected]>

* openhab#83 Add info if a channel is writable to README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#84 Adjust/Add descriptions of supported devices

Signed-off-by: Christian Oeing <[email protected]>

* openhab#25 Add humidity level service and wall thermostat handler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#25 Add wall thermostat handler to handler factory

Signed-off-by: Christian Oeing <[email protected]>

* openhab#66 Check type of service state when received by bridge to make sure that it has the expected type

Signed-off-by: Christian Oeing <[email protected]>

* openhab#41 Add child lock service to Thermostat handler and link its state to a "child-lock" channel

Signed-off-by: Christian Oeing <[email protected]>

* Add null check in BoschSHCServiceState.isValid

Signed-off-by: Christian Oeing <[email protected]>

* openhab#41 Use custom channel type for child-lock. Handle setting child lock state.

Signed-off-by: Christian Oeing <[email protected]>

* openhab#101 Store expected state type inside a member instead of a static variable

The static variable was stored in the base class, so it was only initialized once even for different state types

Signed-off-by: Christian Oeing <[email protected]>

* openhab#63 Use better identifier for thing that is missing a (valid) bridge

Signed-off-by: Christian Oeing <[email protected]>

* openhab#108 Add changelog to README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#109 Catch possible null pointer exception in long poll response handling

Signed-off-by: Christian Oeing <[email protected]>

* Fix potential null pointer access

Signed-off-by: Christian Oeing <[email protected]>

* Fix static code analysis error and 2 warnings

Signed-off-by: Christian Oeing <[email protected]>

* openhab#111 Remove changelog from README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#112 Remove JSON from logs

Signed-off-by: Christian Oeing <[email protected]>

Co-authored-by: Stefan Kaestle <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Co-authored-by: Christian Oeing <[email protected]>
Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Dave J Schoepel <[email protected]>
NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this issue Dec 30, 2021
…nal refactoring (openhab#11134)

* Reduce debug output

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added meta information for Bosch binding

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Set binding online only if fetching rooms and devices worked

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Replaced hard-coded IP address with configuration from things file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixes after rebasing on 2.5.x branch

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put keystore where openhab user can access it

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Attempt to get a new subscription ID when the old one is invalidated

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Better install script

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Asynchronously get subscription ID

Otherwise, code would get stuck on requesting second subscription ID
Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Initial steps towards pairing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Doesn't compile because of bouncycastle - compiles if commented out

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Bumped version

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added basic support for multiple devices to support Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Support for power meter in power switches + all values from Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add window contact to the list of supported things

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Updated README to indicate new supported devices

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added missing file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added motion detector thing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* All devices support RefreshType now

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleanup - removed pairing related stuff that doesn't work

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed a weird bug where InWallSwitchHandler was not an instance of SHCHandler

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Update BoschSHCBridgeHandler.java

fixed HTTP request URL to get rooms from SHC

Signed-off-by: Gerd Zanker <[email protected]>

* Add handler for Bosch Shutter Control to get and set its open level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Auto update of .classpath by IDE

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle PercentType command to set a specific shutter level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put service name in constant instead of using it hard coded twice

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Refactor putState method of BoschSHCBridgeHandler

Remove unnecessary parts of the request like Gateway ID and put some general logic into separate methods to reuse them in other functions later

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Send operation state STOPPED to stop shutter from moving

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add shutter control to supported devices in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add null reference check to avoid a NullReferenceException in ShutterControlHandler if device state couldn't be fetched

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add TemperatureLevelService

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add ThermostatHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add valve tappet position channel to thermostat via ValveTappet service

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add service registration for BoschSHCHandler, so the state updates are automatically calling the registered state update callback of the handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add affectedChannels to service registration and handle RefreshType directly in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleaned up DeviceStatusUpdate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added Bosch SHC certs

added public certificates from https://github.com/BoschSmartHome/bosch-shc-api-docs/tree/master/best_practice

Signed-off-by: Gerd Zanker <[email protected]>

* added pairing support

added support for keystore creation and pairing
documented the process in readme
refactoring of httpClient to take care of SSL context

Signed-off-by: Gerd Zanker <[email protected]>

* Add RoomClimateControlService and ClimateControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle command to set setpoint temperature and move conversion from service state data to thing states into service state classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove unnecessary imports from ThermostatHandler.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make new service and handler @NonNullByDefault

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added comments for climate control service, handler and base service and handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add missing comments on new classes and their methods

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make registerService method of BoschSHCHandler private and adjust usages

Derived handlers should use createService instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw an error instead of returning null for method getBridgeHandler of BoschSHCHandler

This allows for fewer null checks after the initialization of a handler.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @author tags in JavaDoc of new classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Ran mvn spotless:apply to apply correct code formatting

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed missing imports in BoschSHCService.java

This was caused by a too quick merge of me.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed warnings about null annotations

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to all handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added license header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#16 Adjust logger usages to not be too verbose

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#10 Remove obsolete parse-things.py script

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#29 Remove dev scripts install.sh and run.sh scripts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added author name to each class comment

Added the author(s) and small comment to each class based on the git
history and if necessary created the basis class comment body.

Signed-off-by: Gerd Zanker <[email protected]>

* added license header for new files

Signed-off-by: Gerd Zanker <[email protected]>

* run mvn spotless check/apply

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#24 Catch error response when trying to get state of a service of a device and throw specific error instead of returning invalid state object

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#24 Run mvn spotless:apply and mvn license:format to respect coding guidelines

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#5 Update README.md with up-to-date information about the setup of the binding

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#31 Typo in README.md

Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add detailed description of the system password to provide in README.md

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix non-initialized member of @NonNullByDefault class ValveTappetServiceState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#7 Moved each device to a separate subfolder inside devices folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#44 Adjust version of org.openhab.addons.reactor.bundles to 2.5.9-SNAPSHOT in pom.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Increase year in copyright headers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Remove several obsolete loggers and fix logging of exceptions

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Fixed some code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Ran mvn spotless:apply

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Revert adding @NonNullByDefault to BoschSHCConfiguration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Fixed code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* updated text files based on pull request feedback

Signed-off-by: Gerd Zanker <[email protected]>

* Apply suggestions from code review

Applied only suggested string text changes and few trivial code changes

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Improved comments and changed visibility

code review findings improved related to code comments
and public/private visibility of variables
removed example properties file and class path entries

Signed-off-by: Gerd Zanker <[email protected]>

* added @NonNullByDefault annotation where necessary and easy possible

in addition minor improvements like
removed TODO for code refactoring
used BoschSHCException instead of Error in one place
Renamed internal Error class to ErroInfo
ran spotless:apply

Signed-off-by: Gerd Zanker <[email protected]>

* use SIUnits

replaced all Celcius units with eclipse SIUnits

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* change logging and GSON related code

increased many log levels
avoid creating new GSON instances in derived handler subclasses
changed catch code to avoid stack trace dumps

Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to BoschSHCConfiguration class and remove obsolete usages of configuration in handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw BoschSHCExceptions instead of generic Errors and handle them during creation of services

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Class::new supplier function instead of deprecated Class.newInstance() method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove @NonNullByDefault from inner classes and unused logger member to remove compile warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Base64.getEncoder().encodeToString instead of Base64.getEncoder().encode and a manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault annotation to BoschSHCBridgeConfiguration and check for empty password and ip address in configuration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use try-with-resources to auto-close streams for key store creation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move data transfer objects of bridge into dto folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add thing type ids and channel type ids to README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move thing configurations out of thing-types.xml and into configs.xml. Remove deprecated required element and use attribute instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Adjust some elements, units, descriptions and labels in configs.xml and thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move url and request creation from BoschSHCBridgeHandler to BoschHttpClient to reuse it inside BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add default timeout to request to smart home controller

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make httpClient of BoschSHCBridgeHandler @nullable and use BoschHttpClient createUrl and createRequest methods where possible

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make gson field in BoschSHCBridgeHandler final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Simplify getDevices method of BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use getContentAsString() instead of getContent() plus manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use instanceof instead of isInstance(...) in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add registerService method to BoschSHCHandler to register already created services, so they can be created in the constructor of a handler and do not have to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using simpler String.format instead of MessageFormatter in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move ShutterControlState into dto subfolder and remove @NonNullByDefault annotation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make bridgeHandler and deviceId in BoschSHCService @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move DTOs in dto subfolders and remove @NonNullByDefault annotations from them

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add texts for errors during initialization of bridge

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Migrate PowerSwitch to new service architecture to get rid of BoschSHCBridgeHandler.updateSwitchState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete null parameter from subscription request

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Removed obsolete TODO about hard-coded data which does not exist anymore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use lambda for response handling of long poll

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete @nonnull annotations in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw http exceptions when trying to request state from a device to set the thing to offline

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add state options for combined-rating, temperature-rating and humidity-rating channels

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix several minor static code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added migration artifacts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix formatting and increase version number

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fix HTTP client issue, improve connection logging, add Developers markdown

the HTTPClient requests were broken
updated exception handling and logging for connection and pairing
describing source of certificates

Signed-off-by: Gerd Zanker <[email protected]>

* Use service for shutter control handling instead of having the logic inside the ShutterControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Fix code formatting to remove code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed pairing

Signed-off-by: Gerd Zanker <[email protected]>

* Fixed long poll

Signed-off-by: Gerd Zanker <[email protected]>

* Move common error handling for parsing responses from BoschHttpClient into sendRequest method to make subscribe request logic clearer

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use scheduler.schedule instead of Thread.sleep during long polling

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using synchronous request for subscribe request

The initialization is not finished without a successful subscription.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use synchronous long poll request to get it to work

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling asynchronous to not block scheduler threads

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Only scheduling new long polls while bridge is not disposed and aborting long polling on disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move long polling logic into separate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling requests synchronous again, the asynchronous way still does not receive any state updates

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* replaced while loop for pairing with scheduler calls

Pattern from LongPolling reused.
Scheduling new initial access checks including pairing every 15 seconds until it was successful and long polling can be started

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Throw BoschSHCException instead of raw error to avoid code analysis warning

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Remove TODO from code and add issue openhab#55 instead

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Pass non-null httpClient to bridge initialization instead of having to check for null reference

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use one supportsThingTypes mapping to list the supported things with their handler in BoschSHCHandlerFactory

Previously an array plus a big switch was required.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Starting http client before scheduling initial access

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use logger.debug instead of logger.info

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Include cause exception in the PairingFailedException

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move fields above constructor in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete configuration field from BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move fields and constructor in JsonRpcRequest to top of the class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Log the failure of a long poll as warning instead of error

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use %s instead of {} as placeholder for String.format

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move @nullable annotation in front of field name

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Specify UTF_8 as charset to convert string to byte array

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove spaces from pem files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change ArrayList to List in Device.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use QuantityType for power and energy consumption of the in-wall switch handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Check if StopMoveType is STOP in ShutterControlHandler before setting the device state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Make fields of DeviceService final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Stop http client and cancel scheduled pairing on bridge disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove channel check in BoschTwinguardHandler for Refresh command

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add exception message to warning when update in BoschTwinguardHandler and WindowContactHandler returns incorrect state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add additional information about channels to thing-types.xml and README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove confusing comment from LongPolling.subscribe method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Removed obsolete error log in LongPolling.subscribe

A warning is already logged in BoschBridgeHandler when an exception occurs

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add detailed description for purity channel

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fix typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change scheduledPairing field in BoschSHCBridgeHandler to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change type of channel values from DecimalType to QuantityType in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete .classpath and .project files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fixed typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Only log error message instead of whole stack trace in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove exception which is not thrown and typo in BoschSslUtil

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use SmartHomeUnits instead of AbstractUnit in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Added supported-bridge-type-refs to thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove invalid whitespace from thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fixed warnings and errors caused by updated Gson library

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Update info about auto reload of bundle jar in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Update information about adding items and things via UI, added missing password configuration value and changed headline in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Execute long polling requests asynchronous to not block a thread

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Refactored WindowContactHandler to use ShutterContactService instead of implementing service logic itself

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete .gitignore. The ignored files are already ignored by the root .gitignore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Rename constant supportsThingTypes to SUPPORTED_THING_TYPES in BoschSHCHandlerFactory

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use List.of instead of Arrays.asList

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Call super.dispose last in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add exception message to status when http connection to controller fails

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Handle JsonSyntaxException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Forward InterruptedExceptions to callers, so they have to be handled correctly

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Logging long poll error message and code instead of hash

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Throwing InterruptedException during pairing instead of only logging it

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move nested class AbortLongPolling to end of LongPolling class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Make gson instance static final in BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Rename gson to GSON and make it static final in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove @nullable annotations from GSON-created objects

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add causing exception to ExecutionException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add JsonSyntaxException to definition of processUpdate in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fixed keyStore creation

Moved PEM files into expected folder according to package

Signed-off-by: Gerd Zanker <[email protected]>

* moved final fields above non-final fields

Signed-off-by: Gerd Zanker <[email protected]>

* updated copyright year in header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* fixed last two pending warnings

added back the removed @nullable annotation in sendRequest()
replaced deprecated SslContextFactory constructor call

Signed-off-by: Gerd Zanker <[email protected]>

* added Bouncy Castle third-party license info into NOTICE

Signed-off-by: Gerd Zanker <[email protected]>

* changed Bouncy Castle version to same version as  currently used in org.openhab.core.io.jetty.certificate to later reduce download size

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Correctly check if long poll response is valid

GSON will not return null if there is no "result" field, but will just set the "result" member to null.

Signed-off-by: Christian Oeing <[email protected]>

* Add @NonNullByDefault annotation to LongPollResultTest class and fix method name

Signed-off-by: Christian Oeing <[email protected]>

* added first unittests for BoschSslUtil class

Signed-off-by: Gerd Zanker <[email protected]>

* added next unittests for BoschHttpClient class

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#55 replaced the password with a fixed one

The changeable SHC system password for the keystore is replaced by a static string in the code.
The keyStore name is now based on SHC ipAddress to support multiple SmartHomeControllers.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* openhab#62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* openhab#76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* openhab#78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* openhab#62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* openhab#76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* openhab#78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* added newline

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#46 Rename BoschInWallSwitchHandler, BoschTwinguardHandler, BoschSHCBridgeConfiguration and BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#46 Adjust descriptions of things

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Use LatestMotionService in MotionDetectorHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Use service instead of custom logic in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Add PowerMeterService to use in InWallSwitchHandler instead of having the logic directly in the handler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Rename InWallSwitchHandler to LightControlHandler

This is the official name in the Bosch API documentation, so we should use it as well (https://apidocs.bosch-smarthome.com/local)

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Get device info on thing initialization to check if device exists

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Use generic sendRequest method of http client to have consistent error handling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Fix formatting error when logging device info

Signed-off-by: Christian Oeing <[email protected]>

* openhab#83 Add info if a channel is writable to README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#84 Adjust/Add descriptions of supported devices

Signed-off-by: Christian Oeing <[email protected]>

* openhab#25 Add humidity level service and wall thermostat handler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#25 Add wall thermostat handler to handler factory

Signed-off-by: Christian Oeing <[email protected]>

* openhab#66 Check type of service state when received by bridge to make sure that it has the expected type

Signed-off-by: Christian Oeing <[email protected]>

* openhab#41 Add child lock service to Thermostat handler and link its state to a "child-lock" channel

Signed-off-by: Christian Oeing <[email protected]>

* Add null check in BoschSHCServiceState.isValid

Signed-off-by: Christian Oeing <[email protected]>

* openhab#41 Use custom channel type for child-lock. Handle setting child lock state.

Signed-off-by: Christian Oeing <[email protected]>

* openhab#101 Store expected state type inside a member instead of a static variable

The static variable was stored in the base class, so it was only initialized once even for different state types

Signed-off-by: Christian Oeing <[email protected]>

* openhab#63 Use better identifier for thing that is missing a (valid) bridge

Signed-off-by: Christian Oeing <[email protected]>

* openhab#108 Add changelog to README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#109 Catch possible null pointer exception in long poll response handling

Signed-off-by: Christian Oeing <[email protected]>

* Fix potential null pointer access

Signed-off-by: Christian Oeing <[email protected]>

* Fix static code analysis error and 2 warnings

Signed-off-by: Christian Oeing <[email protected]>

* openhab#111 Remove changelog from README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#112 Remove JSON from logs

Signed-off-by: Christian Oeing <[email protected]>

Co-authored-by: Stefan Kaestle <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Co-authored-by: Christian Oeing <[email protected]>
Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Nick Waterton <[email protected]>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this issue Jan 28, 2022
…nal refactoring (openhab#11134)

* Reduce debug output

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added meta information for Bosch binding

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Set binding online only if fetching rooms and devices worked

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Replaced hard-coded IP address with configuration from things file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixes after rebasing on 2.5.x branch

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put keystore where openhab user can access it

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Attempt to get a new subscription ID when the old one is invalidated

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Better install script

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Asynchronously get subscription ID

Otherwise, code would get stuck on requesting second subscription ID
Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Initial steps towards pairing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Doesn't compile because of bouncycastle - compiles if commented out

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Bumped version

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added basic support for multiple devices to support Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Support for power meter in power switches + all values from Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add window contact to the list of supported things

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Updated README to indicate new supported devices

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added missing file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added motion detector thing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* All devices support RefreshType now

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleanup - removed pairing related stuff that doesn't work

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed a weird bug where InWallSwitchHandler was not an instance of SHCHandler

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Update BoschSHCBridgeHandler.java

fixed HTTP request URL to get rooms from SHC

Signed-off-by: Gerd Zanker <[email protected]>

* Add handler for Bosch Shutter Control to get and set its open level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Auto update of .classpath by IDE

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle PercentType command to set a specific shutter level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put service name in constant instead of using it hard coded twice

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Refactor putState method of BoschSHCBridgeHandler

Remove unnecessary parts of the request like Gateway ID and put some general logic into separate methods to reuse them in other functions later

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Send operation state STOPPED to stop shutter from moving

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add shutter control to supported devices in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add null reference check to avoid a NullReferenceException in ShutterControlHandler if device state couldn't be fetched

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add TemperatureLevelService

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add ThermostatHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add valve tappet position channel to thermostat via ValveTappet service

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add service registration for BoschSHCHandler, so the state updates are automatically calling the registered state update callback of the handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add affectedChannels to service registration and handle RefreshType directly in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleaned up DeviceStatusUpdate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added Bosch SHC certs

added public certificates from https://github.com/BoschSmartHome/bosch-shc-api-docs/tree/master/best_practice

Signed-off-by: Gerd Zanker <[email protected]>

* added pairing support

added support for keystore creation and pairing
documented the process in readme
refactoring of httpClient to take care of SSL context

Signed-off-by: Gerd Zanker <[email protected]>

* Add RoomClimateControlService and ClimateControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle command to set setpoint temperature and move conversion from service state data to thing states into service state classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove unnecessary imports from ThermostatHandler.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make new service and handler @NonNullByDefault

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added comments for climate control service, handler and base service and handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add missing comments on new classes and their methods

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make registerService method of BoschSHCHandler private and adjust usages

Derived handlers should use createService instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw an error instead of returning null for method getBridgeHandler of BoschSHCHandler

This allows for fewer null checks after the initialization of a handler.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @author tags in JavaDoc of new classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Ran mvn spotless:apply to apply correct code formatting

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed missing imports in BoschSHCService.java

This was caused by a too quick merge of me.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed warnings about null annotations

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to all handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added license header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#16 Adjust logger usages to not be too verbose

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#10 Remove obsolete parse-things.py script

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#29 Remove dev scripts install.sh and run.sh scripts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added author name to each class comment

Added the author(s) and small comment to each class based on the git
history and if necessary created the basis class comment body.

Signed-off-by: Gerd Zanker <[email protected]>

* added license header for new files

Signed-off-by: Gerd Zanker <[email protected]>

* run mvn spotless check/apply

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#24 Catch error response when trying to get state of a service of a device and throw specific error instead of returning invalid state object

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#24 Run mvn spotless:apply and mvn license:format to respect coding guidelines

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#5 Update README.md with up-to-date information about the setup of the binding

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#31 Typo in README.md

Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add detailed description of the system password to provide in README.md

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix non-initialized member of @NonNullByDefault class ValveTappetServiceState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#7 Moved each device to a separate subfolder inside devices folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#44 Adjust version of org.openhab.addons.reactor.bundles to 2.5.9-SNAPSHOT in pom.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Increase year in copyright headers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Remove several obsolete loggers and fix logging of exceptions

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Fixed some code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Ran mvn spotless:apply

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Revert adding @NonNullByDefault to BoschSHCConfiguration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Fixed code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* updated text files based on pull request feedback

Signed-off-by: Gerd Zanker <[email protected]>

* Apply suggestions from code review

Applied only suggested string text changes and few trivial code changes

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Improved comments and changed visibility

code review findings improved related to code comments
and public/private visibility of variables
removed example properties file and class path entries

Signed-off-by: Gerd Zanker <[email protected]>

* added @NonNullByDefault annotation where necessary and easy possible

in addition minor improvements like
removed TODO for code refactoring
used BoschSHCException instead of Error in one place
Renamed internal Error class to ErroInfo
ran spotless:apply

Signed-off-by: Gerd Zanker <[email protected]>

* use SIUnits

replaced all Celcius units with eclipse SIUnits

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* change logging and GSON related code

increased many log levels
avoid creating new GSON instances in derived handler subclasses
changed catch code to avoid stack trace dumps

Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to BoschSHCConfiguration class and remove obsolete usages of configuration in handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw BoschSHCExceptions instead of generic Errors and handle them during creation of services

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Class::new supplier function instead of deprecated Class.newInstance() method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove @NonNullByDefault from inner classes and unused logger member to remove compile warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Base64.getEncoder().encodeToString instead of Base64.getEncoder().encode and a manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault annotation to BoschSHCBridgeConfiguration and check for empty password and ip address in configuration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use try-with-resources to auto-close streams for key store creation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move data transfer objects of bridge into dto folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add thing type ids and channel type ids to README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move thing configurations out of thing-types.xml and into configs.xml. Remove deprecated required element and use attribute instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Adjust some elements, units, descriptions and labels in configs.xml and thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move url and request creation from BoschSHCBridgeHandler to BoschHttpClient to reuse it inside BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add default timeout to request to smart home controller

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make httpClient of BoschSHCBridgeHandler @nullable and use BoschHttpClient createUrl and createRequest methods where possible

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make gson field in BoschSHCBridgeHandler final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Simplify getDevices method of BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use getContentAsString() instead of getContent() plus manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use instanceof instead of isInstance(...) in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add registerService method to BoschSHCHandler to register already created services, so they can be created in the constructor of a handler and do not have to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using simpler String.format instead of MessageFormatter in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move ShutterControlState into dto subfolder and remove @NonNullByDefault annotation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make bridgeHandler and deviceId in BoschSHCService @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move DTOs in dto subfolders and remove @NonNullByDefault annotations from them

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add texts for errors during initialization of bridge

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Migrate PowerSwitch to new service architecture to get rid of BoschSHCBridgeHandler.updateSwitchState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete null parameter from subscription request

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Removed obsolete TODO about hard-coded data which does not exist anymore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use lambda for response handling of long poll

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete @nonnull annotations in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw http exceptions when trying to request state from a device to set the thing to offline

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add state options for combined-rating, temperature-rating and humidity-rating channels

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix several minor static code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added migration artifacts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix formatting and increase version number

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fix HTTP client issue, improve connection logging, add Developers markdown

the HTTPClient requests were broken
updated exception handling and logging for connection and pairing
describing source of certificates

Signed-off-by: Gerd Zanker <[email protected]>

* Use service for shutter control handling instead of having the logic inside the ShutterControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Fix code formatting to remove code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed pairing

Signed-off-by: Gerd Zanker <[email protected]>

* Fixed long poll

Signed-off-by: Gerd Zanker <[email protected]>

* Move common error handling for parsing responses from BoschHttpClient into sendRequest method to make subscribe request logic clearer

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use scheduler.schedule instead of Thread.sleep during long polling

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using synchronous request for subscribe request

The initialization is not finished without a successful subscription.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use synchronous long poll request to get it to work

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling asynchronous to not block scheduler threads

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Only scheduling new long polls while bridge is not disposed and aborting long polling on disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move long polling logic into separate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling requests synchronous again, the asynchronous way still does not receive any state updates

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* replaced while loop for pairing with scheduler calls

Pattern from LongPolling reused.
Scheduling new initial access checks including pairing every 15 seconds until it was successful and long polling can be started

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Throw BoschSHCException instead of raw error to avoid code analysis warning

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Remove TODO from code and add issue openhab#55 instead

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Pass non-null httpClient to bridge initialization instead of having to check for null reference

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use one supportsThingTypes mapping to list the supported things with their handler in BoschSHCHandlerFactory

Previously an array plus a big switch was required.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Starting http client before scheduling initial access

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use logger.debug instead of logger.info

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Include cause exception in the PairingFailedException

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move fields above constructor in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete configuration field from BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move fields and constructor in JsonRpcRequest to top of the class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Log the failure of a long poll as warning instead of error

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use %s instead of {} as placeholder for String.format

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move @nullable annotation in front of field name

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Specify UTF_8 as charset to convert string to byte array

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove spaces from pem files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change ArrayList to List in Device.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use QuantityType for power and energy consumption of the in-wall switch handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Check if StopMoveType is STOP in ShutterControlHandler before setting the device state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Make fields of DeviceService final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Stop http client and cancel scheduled pairing on bridge disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove channel check in BoschTwinguardHandler for Refresh command

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add exception message to warning when update in BoschTwinguardHandler and WindowContactHandler returns incorrect state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add additional information about channels to thing-types.xml and README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove confusing comment from LongPolling.subscribe method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Removed obsolete error log in LongPolling.subscribe

A warning is already logged in BoschBridgeHandler when an exception occurs

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add detailed description for purity channel

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fix typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change scheduledPairing field in BoschSHCBridgeHandler to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change type of channel values from DecimalType to QuantityType in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete .classpath and .project files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fixed typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Only log error message instead of whole stack trace in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove exception which is not thrown and typo in BoschSslUtil

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use SmartHomeUnits instead of AbstractUnit in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Added supported-bridge-type-refs to thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove invalid whitespace from thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fixed warnings and errors caused by updated Gson library

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Update info about auto reload of bundle jar in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Update information about adding items and things via UI, added missing password configuration value and changed headline in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Execute long polling requests asynchronous to not block a thread

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Refactored WindowContactHandler to use ShutterContactService instead of implementing service logic itself

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete .gitignore. The ignored files are already ignored by the root .gitignore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Rename constant supportsThingTypes to SUPPORTED_THING_TYPES in BoschSHCHandlerFactory

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use List.of instead of Arrays.asList

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Call super.dispose last in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add exception message to status when http connection to controller fails

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Handle JsonSyntaxException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Forward InterruptedExceptions to callers, so they have to be handled correctly

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Logging long poll error message and code instead of hash

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Throwing InterruptedException during pairing instead of only logging it

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move nested class AbortLongPolling to end of LongPolling class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Make gson instance static final in BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Rename gson to GSON and make it static final in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove @nullable annotations from GSON-created objects

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add causing exception to ExecutionException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add JsonSyntaxException to definition of processUpdate in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fixed keyStore creation

Moved PEM files into expected folder according to package

Signed-off-by: Gerd Zanker <[email protected]>

* moved final fields above non-final fields

Signed-off-by: Gerd Zanker <[email protected]>

* updated copyright year in header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* fixed last two pending warnings

added back the removed @nullable annotation in sendRequest()
replaced deprecated SslContextFactory constructor call

Signed-off-by: Gerd Zanker <[email protected]>

* added Bouncy Castle third-party license info into NOTICE

Signed-off-by: Gerd Zanker <[email protected]>

* changed Bouncy Castle version to same version as  currently used in org.openhab.core.io.jetty.certificate to later reduce download size

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Correctly check if long poll response is valid

GSON will not return null if there is no "result" field, but will just set the "result" member to null.

Signed-off-by: Christian Oeing <[email protected]>

* Add @NonNullByDefault annotation to LongPollResultTest class and fix method name

Signed-off-by: Christian Oeing <[email protected]>

* added first unittests for BoschSslUtil class

Signed-off-by: Gerd Zanker <[email protected]>

* added next unittests for BoschHttpClient class

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#55 replaced the password with a fixed one

The changeable SHC system password for the keystore is replaced by a static string in the code.
The keyStore name is now based on SHC ipAddress to support multiple SmartHomeControllers.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* openhab#62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* openhab#76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* openhab#78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* openhab#62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* openhab#76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* openhab#78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* added newline

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#46 Rename BoschInWallSwitchHandler, BoschTwinguardHandler, BoschSHCBridgeConfiguration and BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#46 Adjust descriptions of things

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Use LatestMotionService in MotionDetectorHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Use service instead of custom logic in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Add PowerMeterService to use in InWallSwitchHandler instead of having the logic directly in the handler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Rename InWallSwitchHandler to LightControlHandler

This is the official name in the Bosch API documentation, so we should use it as well (https://apidocs.bosch-smarthome.com/local)

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Get device info on thing initialization to check if device exists

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Use generic sendRequest method of http client to have consistent error handling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Fix formatting error when logging device info

Signed-off-by: Christian Oeing <[email protected]>

* openhab#83 Add info if a channel is writable to README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#84 Adjust/Add descriptions of supported devices

Signed-off-by: Christian Oeing <[email protected]>

* openhab#25 Add humidity level service and wall thermostat handler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#25 Add wall thermostat handler to handler factory

Signed-off-by: Christian Oeing <[email protected]>

* openhab#66 Check type of service state when received by bridge to make sure that it has the expected type

Signed-off-by: Christian Oeing <[email protected]>

* openhab#41 Add child lock service to Thermostat handler and link its state to a "child-lock" channel

Signed-off-by: Christian Oeing <[email protected]>

* Add null check in BoschSHCServiceState.isValid

Signed-off-by: Christian Oeing <[email protected]>

* openhab#41 Use custom channel type for child-lock. Handle setting child lock state.

Signed-off-by: Christian Oeing <[email protected]>

* openhab#101 Store expected state type inside a member instead of a static variable

The static variable was stored in the base class, so it was only initialized once even for different state types

Signed-off-by: Christian Oeing <[email protected]>

* openhab#63 Use better identifier for thing that is missing a (valid) bridge

Signed-off-by: Christian Oeing <[email protected]>

* openhab#108 Add changelog to README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#109 Catch possible null pointer exception in long poll response handling

Signed-off-by: Christian Oeing <[email protected]>

* Fix potential null pointer access

Signed-off-by: Christian Oeing <[email protected]>

* Fix static code analysis error and 2 warnings

Signed-off-by: Christian Oeing <[email protected]>

* openhab#111 Remove changelog from README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#112 Remove JSON from logs

Signed-off-by: Christian Oeing <[email protected]>

Co-authored-by: Stefan Kaestle <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Co-authored-by: Christian Oeing <[email protected]>
Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this issue May 5, 2022
…nal refactoring (openhab#11134)

* Reduce debug output

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added meta information for Bosch binding

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Set binding online only if fetching rooms and devices worked

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Replaced hard-coded IP address with configuration from things file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixes after rebasing on 2.5.x branch

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put keystore where openhab user can access it

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Attempt to get a new subscription ID when the old one is invalidated

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Better install script

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Asynchronously get subscription ID

Otherwise, code would get stuck on requesting second subscription ID
Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Initial steps towards pairing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Doesn't compile because of bouncycastle - compiles if commented out

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Bumped version

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added basic support for multiple devices to support Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Support for power meter in power switches + all values from Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add window contact to the list of supported things

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Updated README to indicate new supported devices

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added missing file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added motion detector thing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* All devices support RefreshType now

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleanup - removed pairing related stuff that doesn't work

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed a weird bug where InWallSwitchHandler was not an instance of SHCHandler

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Update BoschSHCBridgeHandler.java

fixed HTTP request URL to get rooms from SHC

Signed-off-by: Gerd Zanker <[email protected]>

* Add handler for Bosch Shutter Control to get and set its open level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Auto update of .classpath by IDE

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle PercentType command to set a specific shutter level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put service name in constant instead of using it hard coded twice

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Refactor putState method of BoschSHCBridgeHandler

Remove unnecessary parts of the request like Gateway ID and put some general logic into separate methods to reuse them in other functions later

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Send operation state STOPPED to stop shutter from moving

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add shutter control to supported devices in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add null reference check to avoid a NullReferenceException in ShutterControlHandler if device state couldn't be fetched

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add TemperatureLevelService

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add ThermostatHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add valve tappet position channel to thermostat via ValveTappet service

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add service registration for BoschSHCHandler, so the state updates are automatically calling the registered state update callback of the handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add affectedChannels to service registration and handle RefreshType directly in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleaned up DeviceStatusUpdate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added Bosch SHC certs

added public certificates from https://github.com/BoschSmartHome/bosch-shc-api-docs/tree/master/best_practice

Signed-off-by: Gerd Zanker <[email protected]>

* added pairing support

added support for keystore creation and pairing
documented the process in readme
refactoring of httpClient to take care of SSL context

Signed-off-by: Gerd Zanker <[email protected]>

* Add RoomClimateControlService and ClimateControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle command to set setpoint temperature and move conversion from service state data to thing states into service state classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove unnecessary imports from ThermostatHandler.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make new service and handler @NonNullByDefault

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added comments for climate control service, handler and base service and handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add missing comments on new classes and their methods

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make registerService method of BoschSHCHandler private and adjust usages

Derived handlers should use createService instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw an error instead of returning null for method getBridgeHandler of BoschSHCHandler

This allows for fewer null checks after the initialization of a handler.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @author tags in JavaDoc of new classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Ran mvn spotless:apply to apply correct code formatting

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed missing imports in BoschSHCService.java

This was caused by a too quick merge of me.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed warnings about null annotations

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to all handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added license header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#16 Adjust logger usages to not be too verbose

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#10 Remove obsolete parse-things.py script

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#29 Remove dev scripts install.sh and run.sh scripts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added author name to each class comment

Added the author(s) and small comment to each class based on the git
history and if necessary created the basis class comment body.

Signed-off-by: Gerd Zanker <[email protected]>

* added license header for new files

Signed-off-by: Gerd Zanker <[email protected]>

* run mvn spotless check/apply

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#24 Catch error response when trying to get state of a service of a device and throw specific error instead of returning invalid state object

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#24 Run mvn spotless:apply and mvn license:format to respect coding guidelines

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#5 Update README.md with up-to-date information about the setup of the binding

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#31 Typo in README.md

Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add detailed description of the system password to provide in README.md

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix non-initialized member of @NonNullByDefault class ValveTappetServiceState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#7 Moved each device to a separate subfolder inside devices folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#44 Adjust version of org.openhab.addons.reactor.bundles to 2.5.9-SNAPSHOT in pom.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Increase year in copyright headers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Remove several obsolete loggers and fix logging of exceptions

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Fixed some code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Ran mvn spotless:apply

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Revert adding @NonNullByDefault to BoschSHCConfiguration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Fixed code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* updated text files based on pull request feedback

Signed-off-by: Gerd Zanker <[email protected]>

* Apply suggestions from code review

Applied only suggested string text changes and few trivial code changes

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Improved comments and changed visibility

code review findings improved related to code comments
and public/private visibility of variables
removed example properties file and class path entries

Signed-off-by: Gerd Zanker <[email protected]>

* added @NonNullByDefault annotation where necessary and easy possible

in addition minor improvements like
removed TODO for code refactoring
used BoschSHCException instead of Error in one place
Renamed internal Error class to ErroInfo
ran spotless:apply

Signed-off-by: Gerd Zanker <[email protected]>

* use SIUnits

replaced all Celcius units with eclipse SIUnits

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* change logging and GSON related code

increased many log levels
avoid creating new GSON instances in derived handler subclasses
changed catch code to avoid stack trace dumps

Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to BoschSHCConfiguration class and remove obsolete usages of configuration in handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw BoschSHCExceptions instead of generic Errors and handle them during creation of services

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Class::new supplier function instead of deprecated Class.newInstance() method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove @NonNullByDefault from inner classes and unused logger member to remove compile warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Base64.getEncoder().encodeToString instead of Base64.getEncoder().encode and a manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault annotation to BoschSHCBridgeConfiguration and check for empty password and ip address in configuration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use try-with-resources to auto-close streams for key store creation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move data transfer objects of bridge into dto folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add thing type ids and channel type ids to README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move thing configurations out of thing-types.xml and into configs.xml. Remove deprecated required element and use attribute instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Adjust some elements, units, descriptions and labels in configs.xml and thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move url and request creation from BoschSHCBridgeHandler to BoschHttpClient to reuse it inside BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add default timeout to request to smart home controller

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make httpClient of BoschSHCBridgeHandler @nullable and use BoschHttpClient createUrl and createRequest methods where possible

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make gson field in BoschSHCBridgeHandler final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Simplify getDevices method of BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use getContentAsString() instead of getContent() plus manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use instanceof instead of isInstance(...) in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add registerService method to BoschSHCHandler to register already created services, so they can be created in the constructor of a handler and do not have to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using simpler String.format instead of MessageFormatter in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move ShutterControlState into dto subfolder and remove @NonNullByDefault annotation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make bridgeHandler and deviceId in BoschSHCService @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move DTOs in dto subfolders and remove @NonNullByDefault annotations from them

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add texts for errors during initialization of bridge

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Migrate PowerSwitch to new service architecture to get rid of BoschSHCBridgeHandler.updateSwitchState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete null parameter from subscription request

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Removed obsolete TODO about hard-coded data which does not exist anymore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use lambda for response handling of long poll

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete @nonnull annotations in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw http exceptions when trying to request state from a device to set the thing to offline

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add state options for combined-rating, temperature-rating and humidity-rating channels

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix several minor static code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added migration artifacts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix formatting and increase version number

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fix HTTP client issue, improve connection logging, add Developers markdown

the HTTPClient requests were broken
updated exception handling and logging for connection and pairing
describing source of certificates

Signed-off-by: Gerd Zanker <[email protected]>

* Use service for shutter control handling instead of having the logic inside the ShutterControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Fix code formatting to remove code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed pairing

Signed-off-by: Gerd Zanker <[email protected]>

* Fixed long poll

Signed-off-by: Gerd Zanker <[email protected]>

* Move common error handling for parsing responses from BoschHttpClient into sendRequest method to make subscribe request logic clearer

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use scheduler.schedule instead of Thread.sleep during long polling

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using synchronous request for subscribe request

The initialization is not finished without a successful subscription.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use synchronous long poll request to get it to work

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling asynchronous to not block scheduler threads

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Only scheduling new long polls while bridge is not disposed and aborting long polling on disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move long polling logic into separate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling requests synchronous again, the asynchronous way still does not receive any state updates

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* replaced while loop for pairing with scheduler calls

Pattern from LongPolling reused.
Scheduling new initial access checks including pairing every 15 seconds until it was successful and long polling can be started

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Throw BoschSHCException instead of raw error to avoid code analysis warning

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Remove TODO from code and add issue openhab#55 instead

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Pass non-null httpClient to bridge initialization instead of having to check for null reference

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use one supportsThingTypes mapping to list the supported things with their handler in BoschSHCHandlerFactory

Previously an array plus a big switch was required.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Starting http client before scheduling initial access

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use logger.debug instead of logger.info

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Include cause exception in the PairingFailedException

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move fields above constructor in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete configuration field from BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move fields and constructor in JsonRpcRequest to top of the class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Log the failure of a long poll as warning instead of error

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use %s instead of {} as placeholder for String.format

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move @nullable annotation in front of field name

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Specify UTF_8 as charset to convert string to byte array

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove spaces from pem files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change ArrayList to List in Device.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use QuantityType for power and energy consumption of the in-wall switch handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Check if StopMoveType is STOP in ShutterControlHandler before setting the device state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Make fields of DeviceService final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Stop http client and cancel scheduled pairing on bridge disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove channel check in BoschTwinguardHandler for Refresh command

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add exception message to warning when update in BoschTwinguardHandler and WindowContactHandler returns incorrect state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add additional information about channels to thing-types.xml and README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove confusing comment from LongPolling.subscribe method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Removed obsolete error log in LongPolling.subscribe

A warning is already logged in BoschBridgeHandler when an exception occurs

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add detailed description for purity channel

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fix typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change scheduledPairing field in BoschSHCBridgeHandler to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change type of channel values from DecimalType to QuantityType in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete .classpath and .project files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fixed typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Only log error message instead of whole stack trace in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove exception which is not thrown and typo in BoschSslUtil

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use SmartHomeUnits instead of AbstractUnit in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Added supported-bridge-type-refs to thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove invalid whitespace from thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fixed warnings and errors caused by updated Gson library

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Update info about auto reload of bundle jar in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Update information about adding items and things via UI, added missing password configuration value and changed headline in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Execute long polling requests asynchronous to not block a thread

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Refactored WindowContactHandler to use ShutterContactService instead of implementing service logic itself

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete .gitignore. The ignored files are already ignored by the root .gitignore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Rename constant supportsThingTypes to SUPPORTED_THING_TYPES in BoschSHCHandlerFactory

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use List.of instead of Arrays.asList

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Call super.dispose last in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add exception message to status when http connection to controller fails

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Handle JsonSyntaxException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Forward InterruptedExceptions to callers, so they have to be handled correctly

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Logging long poll error message and code instead of hash

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Throwing InterruptedException during pairing instead of only logging it

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move nested class AbortLongPolling to end of LongPolling class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Make gson instance static final in BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Rename gson to GSON and make it static final in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove @nullable annotations from GSON-created objects

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add causing exception to ExecutionException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add JsonSyntaxException to definition of processUpdate in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fixed keyStore creation

Moved PEM files into expected folder according to package

Signed-off-by: Gerd Zanker <[email protected]>

* moved final fields above non-final fields

Signed-off-by: Gerd Zanker <[email protected]>

* updated copyright year in header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* fixed last two pending warnings

added back the removed @nullable annotation in sendRequest()
replaced deprecated SslContextFactory constructor call

Signed-off-by: Gerd Zanker <[email protected]>

* added Bouncy Castle third-party license info into NOTICE

Signed-off-by: Gerd Zanker <[email protected]>

* changed Bouncy Castle version to same version as  currently used in org.openhab.core.io.jetty.certificate to later reduce download size

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Correctly check if long poll response is valid

GSON will not return null if there is no "result" field, but will just set the "result" member to null.

Signed-off-by: Christian Oeing <[email protected]>

* Add @NonNullByDefault annotation to LongPollResultTest class and fix method name

Signed-off-by: Christian Oeing <[email protected]>

* added first unittests for BoschSslUtil class

Signed-off-by: Gerd Zanker <[email protected]>

* added next unittests for BoschHttpClient class

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#55 replaced the password with a fixed one

The changeable SHC system password for the keystore is replaced by a static string in the code.
The keyStore name is now based on SHC ipAddress to support multiple SmartHomeControllers.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* openhab#62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* openhab#76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* openhab#78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* openhab#62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* openhab#76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* openhab#78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* added newline

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#46 Rename BoschInWallSwitchHandler, BoschTwinguardHandler, BoschSHCBridgeConfiguration and BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#46 Adjust descriptions of things

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Use LatestMotionService in MotionDetectorHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Use service instead of custom logic in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Add PowerMeterService to use in InWallSwitchHandler instead of having the logic directly in the handler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Rename InWallSwitchHandler to LightControlHandler

This is the official name in the Bosch API documentation, so we should use it as well (https://apidocs.bosch-smarthome.com/local)

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Get device info on thing initialization to check if device exists

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Use generic sendRequest method of http client to have consistent error handling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Fix formatting error when logging device info

Signed-off-by: Christian Oeing <[email protected]>

* openhab#83 Add info if a channel is writable to README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#84 Adjust/Add descriptions of supported devices

Signed-off-by: Christian Oeing <[email protected]>

* openhab#25 Add humidity level service and wall thermostat handler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#25 Add wall thermostat handler to handler factory

Signed-off-by: Christian Oeing <[email protected]>

* openhab#66 Check type of service state when received by bridge to make sure that it has the expected type

Signed-off-by: Christian Oeing <[email protected]>

* openhab#41 Add child lock service to Thermostat handler and link its state to a "child-lock" channel

Signed-off-by: Christian Oeing <[email protected]>

* Add null check in BoschSHCServiceState.isValid

Signed-off-by: Christian Oeing <[email protected]>

* openhab#41 Use custom channel type for child-lock. Handle setting child lock state.

Signed-off-by: Christian Oeing <[email protected]>

* openhab#101 Store expected state type inside a member instead of a static variable

The static variable was stored in the base class, so it was only initialized once even for different state types

Signed-off-by: Christian Oeing <[email protected]>

* openhab#63 Use better identifier for thing that is missing a (valid) bridge

Signed-off-by: Christian Oeing <[email protected]>

* openhab#108 Add changelog to README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#109 Catch possible null pointer exception in long poll response handling

Signed-off-by: Christian Oeing <[email protected]>

* Fix potential null pointer access

Signed-off-by: Christian Oeing <[email protected]>

* Fix static code analysis error and 2 warnings

Signed-off-by: Christian Oeing <[email protected]>

* openhab#111 Remove changelog from README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#112 Remove JSON from logs

Signed-off-by: Christian Oeing <[email protected]>

Co-authored-by: Stefan Kaestle <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Co-authored-by: Christian Oeing <[email protected]>
Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
andan67 pushed a commit to andan67/openhab-addons that referenced this issue Nov 6, 2022
…nal refactoring (openhab#11134)

* Reduce debug output

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added meta information for Bosch binding

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Set binding online only if fetching rooms and devices worked

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Replaced hard-coded IP address with configuration from things file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixes after rebasing on 2.5.x branch

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put keystore where openhab user can access it

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Attempt to get a new subscription ID when the old one is invalidated

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Better install script

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Asynchronously get subscription ID

Otherwise, code would get stuck on requesting second subscription ID
Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Initial steps towards pairing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Doesn't compile because of bouncycastle - compiles if commented out

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Bumped version

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added basic support for multiple devices to support Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Support for power meter in power switches + all values from Twinguard

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add window contact to the list of supported things

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Updated README to indicate new supported devices

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added missing file

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added motion detector thing

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* All devices support RefreshType now

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleanup - removed pairing related stuff that doesn't work

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed a weird bug where InWallSwitchHandler was not an instance of SHCHandler

Signed-off-by: Stefan Kaestle <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Update BoschSHCBridgeHandler.java

fixed HTTP request URL to get rooms from SHC

Signed-off-by: Gerd Zanker <[email protected]>

* Add handler for Bosch Shutter Control to get and set its open level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Auto update of .classpath by IDE

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle PercentType command to set a specific shutter level

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Put service name in constant instead of using it hard coded twice

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Refactor putState method of BoschSHCBridgeHandler

Remove unnecessary parts of the request like Gateway ID and put some general logic into separate methods to reuse them in other functions later

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Send operation state STOPPED to stop shutter from moving

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add shutter control to supported devices in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add null reference check to avoid a NullReferenceException in ShutterControlHandler if device state couldn't be fetched

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add TemperatureLevelService

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add ThermostatHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add valve tappet position channel to thermostat via ValveTappet service

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add service registration for BoschSHCHandler, so the state updates are automatically calling the registered state update callback of the handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add affectedChannels to service registration and handle RefreshType directly in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Cleaned up DeviceStatusUpdate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added Bosch SHC certs

added public certificates from https://github.com/BoschSmartHome/bosch-shc-api-docs/tree/master/best_practice

Signed-off-by: Gerd Zanker <[email protected]>

* added pairing support

added support for keystore creation and pairing
documented the process in readme
refactoring of httpClient to take care of SSL context

Signed-off-by: Gerd Zanker <[email protected]>

* Add RoomClimateControlService and ClimateControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Handle command to set setpoint temperature and move conversion from service state data to thing states into service state classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove unnecessary imports from ThermostatHandler.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make new service and handler @NonNullByDefault

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added comments for climate control service, handler and base service and handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add missing comments on new classes and their methods

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make registerService method of BoschSHCHandler private and adjust usages

Derived handlers should use createService instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw an error instead of returning null for method getBridgeHandler of BoschSHCHandler

This allows for fewer null checks after the initialization of a handler.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @author tags in JavaDoc of new classes

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Ran mvn spotless:apply to apply correct code formatting

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed missing imports in BoschSHCService.java

This was caused by a too quick merge of me.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed warnings about null annotations

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to all handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added license header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#16 Adjust logger usages to not be too verbose

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#10 Remove obsolete parse-things.py script

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#29 Remove dev scripts install.sh and run.sh scripts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* added author name to each class comment

Added the author(s) and small comment to each class based on the git
history and if necessary created the basis class comment body.

Signed-off-by: Gerd Zanker <[email protected]>

* added license header for new files

Signed-off-by: Gerd Zanker <[email protected]>

* run mvn spotless check/apply

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#24 Catch error response when trying to get state of a service of a device and throw specific error instead of returning invalid state object

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#24 Run mvn spotless:apply and mvn license:format to respect coding guidelines

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#5 Update README.md with up-to-date information about the setup of the binding

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#31 Typo in README.md

Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add detailed description of the system password to provide in README.md

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix non-initialized member of @NonNullByDefault class ValveTappetServiceState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#7 Moved each device to a separate subfolder inside devices folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#44 Adjust version of org.openhab.addons.reactor.bundles to 2.5.9-SNAPSHOT in pom.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Increase year in copyright headers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Remove several obsolete loggers and fix logging of exceptions

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Fixed some code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Ran mvn spotless:apply

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#45 Revert adding @NonNullByDefault to BoschSHCConfiguration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Fixed code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* updated text files based on pull request feedback

Signed-off-by: Gerd Zanker <[email protected]>

* Apply suggestions from code review

Applied only suggested string text changes and few trivial code changes

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Improved comments and changed visibility

code review findings improved related to code comments
and public/private visibility of variables
removed example properties file and class path entries

Signed-off-by: Gerd Zanker <[email protected]>

* added @NonNullByDefault annotation where necessary and easy possible

in addition minor improvements like
removed TODO for code refactoring
used BoschSHCException instead of Error in one place
Renamed internal Error class to ErroInfo
ran spotless:apply

Signed-off-by: Gerd Zanker <[email protected]>

* use SIUnits

replaced all Celcius units with eclipse SIUnits

Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* change logging and GSON related code

increased many log levels
avoid creating new GSON instances in derived handler subclasses
changed catch code to avoid stack trace dumps

Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault to BoschSHCConfiguration class and remove obsolete usages of configuration in handlers

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw BoschSHCExceptions instead of generic Errors and handle them during creation of services

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Class::new supplier function instead of deprecated Class.newInstance() method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove @NonNullByDefault from inner classes and unused logger member to remove compile warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use Base64.getEncoder().encodeToString instead of Base64.getEncoder().encode and a manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add @NonNullByDefault annotation to BoschSHCBridgeConfiguration and check for empty password and ip address in configuration

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use try-with-resources to auto-close streams for key store creation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move data transfer objects of bridge into dto folder

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add thing type ids and channel type ids to README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move thing configurations out of thing-types.xml and into configs.xml. Remove deprecated required element and use attribute instead.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Adjust some elements, units, descriptions and labels in configs.xml and thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move url and request creation from BoschSHCBridgeHandler to BoschHttpClient to reuse it inside BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add default timeout to request to smart home controller

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make httpClient of BoschSHCBridgeHandler @nullable and use BoschHttpClient createUrl and createRequest methods where possible

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make gson field in BoschSHCBridgeHandler final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Simplify getDevices method of BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use getContentAsString() instead of getContent() plus manual conversion to String

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use instanceof instead of isInstance(...) in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add registerService method to BoschSHCHandler to register already created services, so they can be created in the constructor of a handler and do not have to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using simpler String.format instead of MessageFormatter in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move ShutterControlState into dto subfolder and remove @NonNullByDefault annotation

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make bridgeHandler and deviceId in BoschSHCService @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move DTOs in dto subfolders and remove @NonNullByDefault annotations from them

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add texts for errors during initialization of bridge

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Migrate PowerSwitch to new service architecture to get rid of BoschSHCBridgeHandler.updateSwitchState

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete null parameter from subscription request

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Removed obsolete TODO about hard-coded data which does not exist anymore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use lambda for response handling of long poll

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Remove obsolete @nonnull annotations in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Throw http exceptions when trying to request state from a device to set the thing to offline

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Add state options for combined-rating, temperature-rating and humidity-rating channels

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix several minor static code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Added migration artifacts

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fix formatting and increase version number

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fix HTTP client issue, improve connection logging, add Developers markdown

the HTTPClient requests were broken
updated exception handling and logging for connection and pairing
describing source of certificates

Signed-off-by: Gerd Zanker <[email protected]>

* Use service for shutter control handling instead of having the logic inside the ShutterControlHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Fix code formatting to remove code analysis warnings

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Fixed pairing

Signed-off-by: Gerd Zanker <[email protected]>

* Fixed long poll

Signed-off-by: Gerd Zanker <[email protected]>

* Move common error handling for parsing responses from BoschHttpClient into sendRequest method to make subscribe request logic clearer

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use scheduler.schedule instead of Thread.sleep during long polling

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Using synchronous request for subscribe request

The initialization is not finished without a successful subscription.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use synchronous long poll request to get it to work

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling asynchronous to not block scheduler threads

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Only scheduling new long polls while bridge is not disposed and aborting long polling on disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Move long polling logic into separate class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Make long polling requests synchronous again, the asynchronous way still does not receive any state updates

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* replaced while loop for pairing with scheduler calls

Pattern from LongPolling reused.
Scheduling new initial access checks including pairing every 15 seconds until it was successful and long polling can be started

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Throw BoschSHCException instead of raw error to avoid code analysis warning

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Remove TODO from code and add issue openhab#55 instead

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Pass non-null httpClient to bridge initialization instead of having to check for null reference

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use one supportsThingTypes mapping to list the supported things with their handler in BoschSHCHandlerFactory

Previously an array plus a big switch was required.

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#47 Starting http client before scheduling initial access

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Use logger.debug instead of logger.info

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* Include cause exception in the PairingFailedException

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move fields above constructor in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete configuration field from BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move fields and constructor in JsonRpcRequest to top of the class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Log the failure of a long poll as warning instead of error

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use %s instead of {} as placeholder for String.format

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move @nullable annotation in front of field name

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Specify UTF_8 as charset to convert string to byte array

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove spaces from pem files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change ArrayList to List in Device.java

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use QuantityType for power and energy consumption of the in-wall switch handler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Check if StopMoveType is STOP in ShutterControlHandler before setting the device state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Make fields of DeviceService final

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Stop http client and cancel scheduled pairing on bridge disposal

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove channel check in BoschTwinguardHandler for Refresh command

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add exception message to warning when update in BoschTwinguardHandler and WindowContactHandler returns incorrect state

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add additional information about channels to thing-types.xml and README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove confusing comment from LongPolling.subscribe method

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Removed obsolete error log in LongPolling.subscribe

A warning is already logged in BoschBridgeHandler when an exception occurs

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add detailed description for purity channel

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fix typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change scheduledPairing field in BoschSHCBridgeHandler to be @nullable

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Change type of channel values from DecimalType to QuantityType in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete .classpath and .project files

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fixed typo in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Only log error message instead of whole stack trace in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove exception which is not thrown and typo in BoschSslUtil

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use SmartHomeUnits instead of AbstractUnit in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Added supported-bridge-type-refs to thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove invalid whitespace from thing-types.xml

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Fixed warnings and errors caused by updated Gson library

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Update info about auto reload of bundle jar in DEVELOPERS.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Update information about adding items and things via UI, added missing password configuration value and changed headline in README.md

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Execute long polling requests asynchronous to not block a thread

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Refactored WindowContactHandler to use ShutterContactService instead of implementing service logic itself

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove obsolete .gitignore. The ignored files are already ignored by the root .gitignore

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Rename constant supportsThingTypes to SUPPORTED_THING_TYPES in BoschSHCHandlerFactory

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Use List.of instead of Arrays.asList

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Call super.dispose last in BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add exception message to status when http connection to controller fails

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Handle JsonSyntaxException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Forward InterruptedExceptions to callers, so they have to be handled correctly

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Logging long poll error message and code instead of hash

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Throwing InterruptedException during pairing instead of only logging it

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Move nested class AbortLongPolling to end of LongPolling class

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Make gson instance static final in BoschHttpClient

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Rename gson to GSON and make it static final in BoschSHCHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Remove @nullable annotations from GSON-created objects

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add causing exception to ExecutionException in BoschHttpClient.sendRequest

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* openhab#14 Add JsonSyntaxException to definition of processUpdate in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>

* fixed keyStore creation

Moved PEM files into expected folder according to package

Signed-off-by: Gerd Zanker <[email protected]>

* moved final fields above non-final fields

Signed-off-by: Gerd Zanker <[email protected]>

* updated copyright year in header by executing mvn license:format

Signed-off-by: Gerd Zanker <[email protected]>

* fixed last two pending warnings

added back the removed @nullable annotation in sendRequest()
replaced deprecated SslContextFactory constructor call

Signed-off-by: Gerd Zanker <[email protected]>

* added Bouncy Castle third-party license info into NOTICE

Signed-off-by: Gerd Zanker <[email protected]>

* changed Bouncy Castle version to same version as  currently used in org.openhab.core.io.jetty.certificate to later reduce download size

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Correctly check if long poll response is valid

GSON will not return null if there is no "result" field, but will just set the "result" member to null.

Signed-off-by: Christian Oeing <[email protected]>

* Add @NonNullByDefault annotation to LongPollResultTest class and fix method name

Signed-off-by: Christian Oeing <[email protected]>

* added first unittests for BoschSslUtil class

Signed-off-by: Gerd Zanker <[email protected]>

* added next unittests for BoschHttpClient class

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#55 replaced the password with a fixed one

The changeable SHC system password for the keystore is replaced by a static string in the code.
The keyStore name is now based on SHC ipAddress to support multiple SmartHomeControllers.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* openhab#62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* openhab#76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* openhab#78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#72 changed use units of measure for the twinguard humidity and purity values

all other QuantityTypes in bindingcode are fine

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#77 changed title of binding to Bosch Smart Home

Replaced the SHC occurrences with Smart Home,
to avoid technical names.

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#62 Try to restart long polling when it fails before taking the thing offline

Signed-off-by: Christian Oeing <[email protected]>

* openhab#62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request

This might be the reason why the subscribe request does never finish or finishes with a timeout

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client

Signed-off-by: Christian Oeing <[email protected]>

* openhab#74 Schedule initial access when long polling fails unexpected

We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism.

Signed-off-by: Christian Oeing <[email protected]>

* Use direct formatting of logger.trace instead of String.format

Signed-off-by: Christian Oeing <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>

* openhab#76 Use i18n texts instead of raw translations for status messages about failed long polling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#76 Use logger.debug instead of logger.warn for long poll error as it is handled now

Signed-off-by: Christian Oeing <[email protected]>

* openhab#78 defined api-version

each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller

Signed-off-by: Gerd Zanker <[email protected]>

* logging bundle version

removed the old static version string
access OSGi bundle version information instead

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#75 improved initial access

- added isOnline check and isAccessPossible now failed in case HTTPStatus is an error
- same HTTPStatus check done to all blocking send() request calls
- using i18n strings for all bridge updateStatus calls
- skipped the 'controller' and use only 'Bosch Smart Home' in descriptions
- added more @nullable annotations

Signed-off-by: Gerd Zanker <[email protected]>

* added newline

Signed-off-by: Gerd Zanker <[email protected]>

* openhab#46 Rename BoschInWallSwitchHandler, BoschTwinguardHandler, BoschSHCBridgeConfiguration and BoschSHCBridgeHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#46 Adjust descriptions of things

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Use LatestMotionService in MotionDetectorHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Use service instead of custom logic in BoschTwinguardHandler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Add PowerMeterService to use in InWallSwitchHandler instead of having the logic directly in the handler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#40 Rename InWallSwitchHandler to LightControlHandler

This is the official name in the Bosch API documentation, so we should use it as well (https://apidocs.bosch-smarthome.com/local)

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Get device info on thing initialization to check if device exists

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Use generic sendRequest method of http client to have consistent error handling

Signed-off-by: Christian Oeing <[email protected]>

* openhab#34 Fix formatting error when logging device info

Signed-off-by: Christian Oeing <[email protected]>

* openhab#83 Add info if a channel is writable to README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#84 Adjust/Add descriptions of supported devices

Signed-off-by: Christian Oeing <[email protected]>

* openhab#25 Add humidity level service and wall thermostat handler

Signed-off-by: Christian Oeing <[email protected]>

* openhab#25 Add wall thermostat handler to handler factory

Signed-off-by: Christian Oeing <[email protected]>

* openhab#66 Check type of service state when received by bridge to make sure that it has the expected type

Signed-off-by: Christian Oeing <[email protected]>

* openhab#41 Add child lock service to Thermostat handler and link its state to a "child-lock" channel

Signed-off-by: Christian Oeing <[email protected]>

* Add null check in BoschSHCServiceState.isValid

Signed-off-by: Christian Oeing <[email protected]>

* openhab#41 Use custom channel type for child-lock. Handle setting child lock state.

Signed-off-by: Christian Oeing <[email protected]>

* openhab#101 Store expected state type inside a member instead of a static variable

The static variable was stored in the base class, so it was only initialized once even for different state types

Signed-off-by: Christian Oeing <[email protected]>

* openhab#63 Use better identifier for thing that is missing a (valid) bridge

Signed-off-by: Christian Oeing <[email protected]>

* openhab#108 Add changelog to README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#109 Catch possible null pointer exception in long poll response handling

Signed-off-by: Christian Oeing <[email protected]>

* Fix potential null pointer access

Signed-off-by: Christian Oeing <[email protected]>

* Fix static code analysis error and 2 warnings

Signed-off-by: Christian Oeing <[email protected]>

* openhab#111 Remove changelog from README.md

Signed-off-by: Christian Oeing <[email protected]>

* openhab#112 Remove JSON from logs

Signed-off-by: Christian Oeing <[email protected]>

Co-authored-by: Stefan Kaestle <[email protected]>
Co-authored-by: Gerd Zanker <[email protected]>
Co-authored-by: Christian Oeing <[email protected]>
Co-authored-by: Hilbrand Bouwkamp <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new binding If someone has started to work on a binding. For a new binding PR.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants