-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from Smarteon/calendar
Calendar fix event list deserialization
- Loading branch information
Showing
6 changed files
with
25 additions
and
85 deletions.
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
17 changes: 15 additions & 2 deletions
17
src/main/java/cz/smarteon/loxone/calendar/CalEntryListValue.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 |
---|---|---|
@@ -1,10 +1,23 @@ | ||
package cz.smarteon.loxone.calendar; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import cz.smarteon.loxone.Codec; | ||
import cz.smarteon.loxone.message.LoxoneValue; | ||
import lombok.Getter; | ||
|
||
import java.util.ArrayList; | ||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
/** | ||
* {@link LoxoneValue} where the JSON string is expected to encode a list of calendar entries. | ||
*/ | ||
public class CalEntryListValue extends ArrayList<CalEntryBase> implements LoxoneValue { } | ||
@Getter | ||
public class CalEntryListValue implements LoxoneValue { | ||
|
||
private final List<CalEntryBase> events; | ||
|
||
@JsonCreator | ||
protected CalEntryListValue(String events) throws IOException { | ||
this.events = Codec.readList(events, CalEntryBase.class); | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1 @@ | ||
[ | ||
{ | ||
"uuid":"16d36904-0135-387f-ffff6b31da1b15a2", | ||
"name":"Perioda topení", | ||
"operatingMode":10, | ||
"calMode":4, | ||
"startMonth":10, | ||
"startDay":1, | ||
"endMonth":4, | ||
"endDay":30 | ||
}, | ||
{ | ||
"uuid":"16d36904-013c-3883-ffff6b31da1b15a2", | ||
"name":"Perioda chlazení", | ||
"operatingMode":11, | ||
"calMode":4, | ||
"startMonth":5, | ||
"startDay":1, | ||
"endMonth":9, | ||
"endDay":30 | ||
}, | ||
{ | ||
"uuid":"1b6f47bd-0390-9b1e-ffff504f94a03d3e", | ||
"name":"Every year test", | ||
"operatingMode":1, | ||
"calMode":0, | ||
"startMonth":4, | ||
"startDay":1 | ||
}, | ||
{ | ||
"uuid":"1b6f47dd-0243-9b2c-ffff504f94a03d3e", | ||
"name":"Eastern offset test", | ||
"operatingMode":1, | ||
"calMode":1, | ||
"easterOffset":11 | ||
}, | ||
{ | ||
"uuid":"1b6f47f0-03b0-9b3d-ffff504f94a03d3e", | ||
"name":"Single day test", | ||
"operatingMode":1, | ||
"calMode":2, | ||
"startYear":2024, | ||
"startMonth":8, | ||
"startDay":3 | ||
}, | ||
{ | ||
"uuid":"1b6f480b-0393-9b59-ffff504f94a03d3e", | ||
"name":"Period test", | ||
"operatingMode":1, | ||
"calMode":3, | ||
"startYear":2024, | ||
"startMonth":8, | ||
"startDay":3, | ||
"endYear":2024, | ||
"endMonth":8, | ||
"endDay":4 | ||
}, | ||
{ | ||
"uuid":"1b6f49be-025c-9ba0-ffff504f94a03d3e", | ||
"name":"Period every year test", | ||
"operatingMode":1, | ||
"calMode":4, | ||
"startMonth":7, | ||
"startDay":1, | ||
"endMonth":7, | ||
"endDay":6 | ||
}, | ||
{ | ||
"uuid":"1b6f49d6-030f-9bc2-ffff504f94a03d3e", | ||
"name":"Day of week test", | ||
"operatingMode":1, | ||
"calMode":5, | ||
"startMonth":7, | ||
"weekDay":2, | ||
"weekDayInMonth":1 | ||
} | ||
] | ||
"[\n {\n \"uuid\":\"16d36904-0135-387f-ffff6b31da1b15a2\",\n \"name\":\"Perioda topení\",\n \"operatingMode\":10,\n \"calMode\":4,\n \"startMonth\":10,\n \"startDay\":1,\n \"endMonth\":4,\n \"endDay\":30\n },\n {\n \"uuid\":\"16d36904-013c-3883-ffff6b31da1b15a2\",\n \"name\":\"Perioda chlazení\",\n \"operatingMode\":11,\n \"calMode\":4,\n \"startMonth\":5,\n \"startDay\":1,\n \"endMonth\":9,\n \"endDay\":30\n },\n {\n \"uuid\":\"1b6f47bd-0390-9b1e-ffff504f94a03d3e\",\n \"name\":\"Every year test\",\n \"operatingMode\":1,\n \"calMode\":0,\n \"startMonth\":4,\n \"startDay\":1\n },\n {\n \"uuid\":\"1b6f47dd-0243-9b2c-ffff504f94a03d3e\",\n \"name\":\"Eastern offset test\",\n \"operatingMode\":1,\n \"calMode\":1,\n \"easterOffset\":11\n },\n {\n \"uuid\":\"1b6f47f0-03b0-9b3d-ffff504f94a03d3e\",\n \"name\":\"Single day test\",\n \"operatingMode\":1,\n \"calMode\":2,\n \"startYear\":2024,\n \"startMonth\":8,\n \"startDay\":3\n },\n {\n \"uuid\":\"1b6f480b-0393-9b59-ffff504f94a03d3e\",\n \"name\":\"Period test\",\n \"operatingMode\":1,\n \"calMode\":3,\n \"startYear\":2024,\n \"startMonth\":8,\n \"startDay\":3,\n \"endYear\":2024,\n \"endMonth\":8,\n \"endDay\":4\n },\n {\n \"uuid\":\"1b6f49be-025c-9ba0-ffff504f94a03d3e\",\n \"name\":\"Period every year test\",\n \"operatingMode\":1,\n \"calMode\":4,\n \"startMonth\":7,\n \"startDay\":1,\n \"endMonth\":7,\n \"endDay\":6\n },\n {\n \"uuid\":\"1b6f49d6-030f-9bc2-ffff504f94a03d3e\",\n \"name\":\"Day of week test\",\n \"operatingMode\":1,\n \"calMode\":5,\n \"startMonth\":7,\n \"weekDay\":2,\n \"weekDayInMonth\":1\n }\n]\n" |