-
Notifications
You must be signed in to change notification settings - Fork 14
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
Updated for FRITZ-Dect 500 devices #16
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/main/java/com/github/kaklakariada/fritzbox/model/homeautomation/ColorControl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* A Java API for managing FritzBox HomeAutomation | ||
* Copyright (C) 2017 Christoph Pirkl <christoph at users.sourceforge.net> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.github.kaklakariada.fritzbox.model.homeautomation; | ||
|
||
import org.simpleframework.xml.Attribute; | ||
import org.simpleframework.xml.Element; | ||
import org.simpleframework.xml.Root; | ||
|
||
@Root(name = "colorcontrol") | ||
public class ColorControl { | ||
@Element(name = "hue", required = false) | ||
private String hue; | ||
|
||
@Element(name = "saturation", required = false) | ||
private String saturation; | ||
|
||
@Element(name = "temperature", required = false) | ||
private String temperature; | ||
|
||
@Attribute(name = "supported_modes") | ||
private String supportedModes; | ||
|
||
@Attribute(name = "current_mode", required = false) | ||
private String current_mode; | ||
|
||
public String getHue() { | ||
return hue; | ||
} | ||
|
||
public String getSaturation() { | ||
return saturation; | ||
} | ||
|
||
public String getTemperature() { | ||
return temperature; | ||
} | ||
|
||
public String getSupportedModes() { | ||
return supportedModes; | ||
} | ||
|
||
public String getCurrent_mode() { | ||
return current_mode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/com/github/kaklakariada/fritzbox/model/homeautomation/EtsiUnitInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* A Java API for managing FritzBox HomeAutomation | ||
* Copyright (C) 2017 Christoph Pirkl <christoph at users.sourceforge.net> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.github.kaklakariada.fritzbox.model.homeautomation; | ||
|
||
import org.simpleframework.xml.Element; | ||
import org.simpleframework.xml.Root; | ||
|
||
@Root(name = "etsiunitinfo") | ||
public class EtsiUnitInfo { | ||
|
||
@Element(name = "etsideviceid") | ||
private int etsideviceid; | ||
|
||
@Element(name = "unittype") | ||
private int unittype; | ||
|
||
@Element(name = "interfaces") | ||
private String interfaces; | ||
|
||
public int getEtsideviceid() { | ||
return etsideviceid; | ||
} | ||
|
||
public int getUnittype() { | ||
return unittype; | ||
} | ||
|
||
public String getInterfaces() { | ||
return interfaces; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/com/github/kaklakariada/fritzbox/model/homeautomation/LevelControl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* A Java API for managing FritzBox HomeAutomation | ||
* Copyright (C) 2017 Christoph Pirkl <christoph at users.sourceforge.net> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.github.kaklakariada.fritzbox.model.homeautomation; | ||
|
||
import org.simpleframework.xml.Element; | ||
import org.simpleframework.xml.Root; | ||
|
||
@Root(name = "levelcontrol") | ||
public class LevelControl { | ||
|
||
@Element(name = "level", required = false) | ||
private int level; | ||
|
||
@Element(name = "levelpercentage", required = false) | ||
private int levelpercentage; | ||
|
||
public int getLevel() { | ||
return level; | ||
} | ||
|
||
public int getLevelpercentage() { | ||
return levelpercentage; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
src/test/resources/deviceListConnectedFritzDect301Payload.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<device identifier="09995 0079863" id="20" functionbitmask="320" fwversion="04.94" manufacturer="AVM" productname="FRITZ!DECT 301"> | ||
<present>1</present> | ||
<txbusy>0</txbusy> | ||
<name>FRITZ!DECT 301</name> | ||
<battery>100</battery> | ||
<batterylow>0</batterylow> | ||
<temperature> | ||
<celsius>235</celsius> | ||
<offset>0</offset> | ||
</temperature> | ||
<hkr> | ||
<tist>47</tist> | ||
<tsoll>46</tsoll> | ||
<absenk>28</absenk> | ||
<komfort>46</komfort> | ||
<lock>0</lock> | ||
<devicelock>0</devicelock> | ||
<errorcode>0</errorcode> | ||
<windowopenactiv>0</windowopenactiv> | ||
<windowopenactiveendtime>0</windowopenactiveendtime> | ||
<boostactive>0</boostactive> | ||
<boostactiveendtime>0</boostactiveendtime> | ||
<batterylow>0</batterylow> | ||
<battery>100</battery> | ||
<nextchange> | ||
<endperiod>1605643200</endperiod> | ||
<tchange>28</tchange> | ||
</nextchange> | ||
<summeractive>0</summeractive> | ||
<holidayactive>0</holidayactive> | ||
</hkr> | ||
</device> |
24 changes: 24 additions & 0 deletions
24
src/test/resources/deviceListConnectedFritzDect500Payload.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<devicelist version="1" fwversion="7.21"> | ||
<device identifier="00000 0000000-1" id="2000" functionbitmask="237572" fwversion="0.0" manufacturer="AVM" productname="FRITZ!DECT 500"> | ||
<present>0</present> | ||
<txbusy>0</txbusy> | ||
<name>FRITZ!DECT 500 power</name> | ||
<simpleonoff> | ||
<state>1</state> | ||
</simpleonoff> | ||
<levelcontrol> | ||
<level>153</level> | ||
<levelpercentage>60</levelpercentage> | ||
</levelcontrol> | ||
<colorcontrol supported_modes="0" current_mode=""> | ||
<hue>225</hue> | ||
<saturation>204</saturation> | ||
<temperature>6500</temperature> | ||
</colorcontrol> | ||
<etsiunitinfo> | ||
<etsideviceid>406</etsideviceid> | ||
<unittype>278</unittype> | ||
<interfaces>512,514,513</interfaces> | ||
</etsiunitinfo> | ||
</device> | ||
</devicelist> |
24 changes: 24 additions & 0 deletions
24
src/test/resources/deviceListNotConnectedFritzDect500Payload.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<devicelist version="1" fwversion="7.21"> | ||
<device identifier="00000 0000000-1" id="2000" functionbitmask="237572" fwversion="0.0" manufacturer="AVM" productname="FRITZ!DECT 500"> | ||
<present>0</present> | ||
<txbusy>0</txbusy> | ||
<name>FRITZ!DECT 500 without power</name> | ||
<simpleonoff> | ||
<state/> | ||
</simpleonoff> | ||
<levelcontrol> | ||
<level/> | ||
<levelpercentage/> | ||
</levelcontrol> | ||
<colorcontrol supported_modes="0" current_mode=""> | ||
<hue/> | ||
<saturation/> | ||
<temperature/> | ||
</colorcontrol> | ||
<etsiunitinfo> | ||
<etsideviceid>406</etsideviceid> | ||
<unittype>278</unittype> | ||
<interfaces>512,514,513</interfaces> | ||
</etsiunitinfo> | ||
</device> | ||
</devicelist> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Thanks for adding tests 👍