]> git.basschouten.com Git - openhab-addons.git/commit
[senechome] Avoid null pointer errors (#12512)
authorThomas Karl Pietrowski <thopiekar@gmail.com>
Mon, 4 Apr 2022 13:06:42 +0000 (15:06 +0200)
committerGitHub <noreply@github.com>
Mon, 4 Apr 2022 13:06:42 +0000 (15:06 +0200)
commit2a2389a7e5757e7673fcb993d47384cb468dc99d
tree39c55d5d4b705e4445b93c83d1ba0884efe9c1cd
parentcdf4101a94752b874239d0bacfa6915d329c37fb
[senechome] Avoid null pointer errors (#12512)

Looks like the new generation of SenecIES power storage systems, which are using LiPo technology, provide additional data in the JSON array.
This data is not available in the old generation, which lead to missing data, when asking for a key and in further null pointer exceptions when going deeper in the data structure.

Therefore making a trivial check to detect the new generation of devices and skip the troubling section entirely.
CON: The section of items would not be updated. A to-do is of course to split the old and new generation into separate models of devices.

Fixes #11606

Also-By: Erwin Guib <eguib@web.de>
Also-By: Korbinian Probst <kp.droid.dev@gmail.com>
Signed-off-by: Thomas Karl Pietrowski <thopiekar@gmail.com>
bundles/org.openhab.binding.senechome/src/main/java/org/openhab/binding/senechome/internal/SenecHomeHandler.java