-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support new device "Blind" and suppy device statistics #34
Conversation
added missing element "Alert" to "Device" Fixed NPE when "switchstate" is null in "Device"
…FritzOS29 to the test resources
…ow can get the normalized values, does not need to calculate by itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your pull request! I am happy to merge it when you fix my review findings.
src/main/java/com/github/kaklakariada/fritzbox/HomeAutomation.java
Outdated
Show resolved
Hide resolved
...ain/java/com/github/kaklakariada/fritzbox/model/homeautomation/AbstractDeviceStatistics.java
Outdated
Show resolved
Hide resolved
...ain/java/com/github/kaklakariada/fritzbox/model/homeautomation/AbstractDeviceStatistics.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/kaklakariada/fritzbox/model/homeautomation/Alert.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/kaklakariada/fritzbox/model/homeautomation/Blind.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/kaklakariada/fritzbox/model/homeautomation/Statistics.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/kaklakariada/fritzbox/model/homeautomation/Statistics.java
Outdated
Show resolved
Hide resolved
build.gradle
Outdated
@@ -44,6 +44,7 @@ dependencies { | |||
implementation 'com.squareup.okhttp3:okhttp:4.9.1' | |||
implementation 'com.subshell.simpleframework:simple-xml:2.9.0' | |||
implementation 'org.slf4j:slf4j-api:1.7.32' | |||
implementation 'org.apache.commons:commons-lang3:3.12.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid adding dependencies. If necessary implement the necessary methods here.
Additional dependencies increase the attack surface in case they contain vulnerabilities. We are responsible to fix/upgrade when we use them.
src/test/java/com/github/kaklakariada/fritzbox/mapping/DeserializerTest.java
Show resolved
Hide resolved
@@ -0,0 +1,15 @@ | |||
<devicestats> | |||
<temperature> | |||
<stats count="96" grid="900">185,185,185,185,180,175,175,180,180,185,180,180,180,175,180,180,175,175,175,175,175,175,175,175,175,175,175,175,180,180,180,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195</stats> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests for parsing a devicestats file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your changes!
Could you please address the remaining issues:
- Replace dependency to commons-lang3
- Add unit tests for statistics
- Fix failing CI build
… from a dto-class to a helper-class
There are still some issues with the PR. I will merge it and fix the issues myself. |
I created release 1.5.0 and published it to Maven Central. It should be available soon at https://repo1.maven.org/maven2/com/github/kaklakariada/fritzbox-java-api/1.5.0/ |
AVM supports a new device "Blind". The companies "Becker" (BoxCTRL) and "Rademacher" (Rollotron DECT 1213) supply the hardware for this. The "getdevicelist" fails because the xml provided by the fritzbox cannot be marshalled to a DeviceList-object. There is no class "Blind", so the tag cannot become instantiated.
The statistic retrieval in TestDriver ist commented out. When I tried, I found it failing due to unsupported commands. I added retrieval of statistics by adding (or updating) the classes "DeviceStats", "Statistics", "Energy", "Power", "Humidity" and "Voltage" (and some helping classes). I also added a JUnit-Test for marshalling the statistics.
The code has been developed by the samples I got when retrieving the data. I'm not sure, whether to docu provided with "AVM Home Automation HTTP Interface" contains really all what is to be known about this. I fear, that, under some cirumstances there might come up another xml-tag which again will fail the marshalling. It looks more like a draft document.
I have added displaying of energy-statistics and power statistics to the sample "TestDriver"