fix PS sync

This commit is contained in:
Milos Kozak 2021-05-13 14:56:10 +02:00
parent 2657830f0d
commit 4f5a407a2f

View file

@ -25,8 +25,8 @@ fun ProfileSwitch.toJson(dateUtil: DateUtil): JSONObject =
.put("duration", T.msecs(duration).mins()) .put("duration", T.msecs(duration).mins())
.put("profile", getCustomizedName()) .put("profile", getCustomizedName())
.put("profileJson", ProfileSealed.PS(this).toPureNsJson(dateUtil).toString()) .put("profileJson", ProfileSealed.PS(this).toPureNsJson(dateUtil).toString())
.put("timeshift", T.msecs(timeshift).hours()) .put("timeshift", 0)
.put("percentage", percentage) .put("percentage", 100) // customization already applied to json
.also { .also {
if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId) if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId)
if (interfaceIDs.pumpType != null) it.put("pumpType", interfaceIDs.pumpType!!.name) if (interfaceIDs.pumpType != null) it.put("pumpType", interfaceIDs.pumpType!!.name)