mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[miio] Fix date parsing issue last cleaning details (#16380)
https://community.openhab.org/t/miio-binding-roborock-s4max-no-longer-getting-last-cleaning-details/153260/3 Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
parent
7a5802b09a
commit
8b2148e121
@ -541,12 +541,14 @@ public class MiIoVacuumHandler extends MiIoAbstractHandler {
|
||||
private void updateHistoryRecord(HistoryRecordDTO historyRecordDTO) {
|
||||
JsonObject historyRecord = GSON.toJsonTree(historyRecordDTO).getAsJsonObject();
|
||||
if (historyRecordDTO.getStart() != null) {
|
||||
historyRecord.addProperty("start", historyRecordDTO.getStart().split("\\+")[0]);
|
||||
updateState(CHANNEL_HISTORY_START_TIME, new DateTimeType(historyRecordDTO.getStart().split("\\+")[0]));
|
||||
historyRecord.addProperty("start", historyRecordDTO.getStart().split("\\+")[0].split("\\-")[0]);
|
||||
updateState(CHANNEL_HISTORY_START_TIME,
|
||||
new DateTimeType(historyRecordDTO.getStart().split("\\+")[0].split("\\-")[0]));
|
||||
}
|
||||
if (historyRecordDTO.getEnd() != null) {
|
||||
historyRecord.addProperty("end", historyRecordDTO.getEnd().split("\\+")[0]);
|
||||
updateState(CHANNEL_HISTORY_END_TIME, new DateTimeType(historyRecordDTO.getEnd().split("\\+")[0]));
|
||||
historyRecord.addProperty("end", historyRecordDTO.getEnd().split("\\+")[0].split("\\-")[0]);
|
||||
updateState(CHANNEL_HISTORY_END_TIME,
|
||||
new DateTimeType(historyRecordDTO.getEnd().split("\\+")[0].split("\\-")[0]));
|
||||
}
|
||||
if (historyRecordDTO.getDuration() != null) {
|
||||
long duration = TimeUnit.SECONDS.toMinutes(historyRecordDTO.getDuration().longValue());
|
||||
|
Loading…
Reference in New Issue
Block a user