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

[innogysmarthome] Fix Battery Warnings (Bug #7956

Merged
merged 2 commits into from
Jun 22, 2020
Merged

[innogysmarthome] Fix Battery Warnings (Bug #7956

merged 2 commits into from
Jun 22, 2020

Conversation

mmans
Copy link

@mmans mmans commented Jun 20, 2020

This PR fixes low battery messages.
Closes: #6932

Root cause: Json field "DeviceLinkList" of a "Message" is renamed (by Innogy) to "Devices".

@mmans mmans requested a review from ollie-dev as a code owner June 20, 2020 16:50
@TravisBuddy
Copy link

Travis tests were successful

Hey @mmans,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

1 similar comment
@TravisBuddy
Copy link

Travis tests were successful

Hey @mmans,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@cpmeister
Copy link
Contributor

I assume that "DeviceLinkList" is still used for other types of messages so shouldn't you use both then?

@mmans
Copy link
Author

mmans commented Jun 20, 2020

Good question. It is only used in a "Message". And the only function that uses the getDeviceLinkList is the LowBattery message. So I thought it could do no harm to change it. If other messages are implemented in the future it could change.

Copy link
Member

@Hilbrand Hilbrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is correct. It looks like with the change to the new innogy api 1.1 some information got lost in the Message class. While some data structures changed in the new api, the changes lost some information. Partly because the json parsing was also changed. So places that used @Key. didn't get a @SerializedName annotation. In this case it had the @Key("Devices"). But besides it being renamed to the lower case devices in the new api, the @SerializedName annotation was not added. I see there are also to other annotations missing:

  • Field isRead should get the annotation @SerializedName("read")
  • Field messageClass should get the annotation @SerializedName("class").

The change here of the field name to devices is ok. But please do also update the javadoc and method parameter in the Message.java class. And while you change that can you also add the 2 other annotations.

So the use of deviceLinkList is not something that will be present in json and this change should not be a problem.

@mmans
Copy link
Author

mmans commented Jun 22, 2020

Hi @Hilbrand

Thanks for your review. I changed the things you mentioned.

Regards,
Marco

@TravisBuddy
Copy link

Travis tests were successful

Hey @mmans,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

1 similar comment
@TravisBuddy
Copy link

Travis tests were successful

Hey @mmans,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Copy link
Member

@Hilbrand Hilbrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hilbrand Hilbrand merged commit 61083da into openhab:2.5.x Jun 22, 2020
@cpmeister cpmeister added the bug An unexpected problem or unintended behavior of an add-on label Jun 24, 2020
@cpmeister cpmeister added this to the 2.5.7 milestone Jun 24, 2020
knikhilwiz pushed a commit to knikhilwiz/openhab2-addons that referenced this pull request Jul 12, 2020
* Renamed DeviceLinkList to Devices
* Updates Javadocs + Added 2 Annotations
Closes openhab#6932

Signed-off-by: Marco Mans <[email protected]>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
* Renamed DeviceLinkList to Devices
* Updates Javadocs + Added 2 Annotations
Closes openhab#6932

Signed-off-by: Marco Mans <[email protected]>
Signed-off-by: CSchlipp <[email protected]>
MPH80 pushed a commit to MPH80/openhab-addons that referenced this pull request Aug 3, 2020
* Renamed DeviceLinkList to Devices
* Updates Javadocs + Added 2 Annotations
Closes openhab#6932

Signed-off-by: Marco Mans <[email protected]>
Signed-off-by: MPH80 <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Renamed DeviceLinkList to Devices
* Updates Javadocs + Added 2 Annotations
Closes openhab#6932

Signed-off-by: Marco Mans <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Renamed DeviceLinkList to Devices
* Updates Javadocs + Added 2 Annotations
Closes openhab#6932

Signed-off-by: Marco Mans <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Renamed DeviceLinkList to Devices
* Updates Javadocs + Added 2 Annotations
Closes openhab#6932

Signed-off-by: Marco Mans <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Renamed DeviceLinkList to Devices
* Updates Javadocs + Added 2 Annotations
Closes openhab#6932

Signed-off-by: Marco Mans <[email protected]>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
* Renamed DeviceLinkList to Devices
* Updates Javadocs + Added 2 Annotations
Closes openhab#6932

Signed-off-by: Marco Mans <[email protected]>
Signed-off-by: Daan Meijer <[email protected]>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
* Renamed DeviceLinkList to Devices
* Updates Javadocs + Added 2 Annotations
Closes openhab#6932

Signed-off-by: Marco Mans <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[innogysmarthome] - Low Battery Message does not change Channel value
4 participants