set timezone
This commit is contained in:
parent
26de3376d2
commit
d882428cc0
|
@ -425,6 +425,9 @@ class OmnipodDashManagerImpl @Inject constructor(
|
||||||
observeConnectToPod,
|
observeConnectToPod,
|
||||||
observeSendProgramBasalCommand(basalProgram, hasBasalBeepEnabled)
|
observeSendProgramBasalCommand(basalProgram, hasBasalBeepEnabled)
|
||||||
)
|
)
|
||||||
|
.doOnComplete {
|
||||||
|
podStateManager.timeZone = TimeZone.getDefault()
|
||||||
|
}
|
||||||
// TODO these would be common for any observable returned in a public function in this class
|
// TODO these would be common for any observable returned in a public function in this class
|
||||||
.doOnNext(PodEventInterceptor())
|
.doOnNext(PodEventInterceptor())
|
||||||
.doOnError(ErrorInterceptor())
|
.doOnError(ErrorInterceptor())
|
||||||
|
|
|
@ -35,7 +35,7 @@ interface OmnipodDashPodStateManager {
|
||||||
val isPodKaput: Boolean
|
val isPodKaput: Boolean
|
||||||
var bluetoothConnectionState: BluetoothConnectionState
|
var bluetoothConnectionState: BluetoothConnectionState
|
||||||
|
|
||||||
var timeZone: String
|
var timeZone: TimeZone
|
||||||
val lastUpdatedSystem: Long // System.currentTimeMillis()
|
val lastUpdatedSystem: Long // System.currentTimeMillis()
|
||||||
val lastStatusResponseReceived: Long
|
val lastStatusResponseReceived: Long
|
||||||
val time: DateTime?
|
val time: DateTime?
|
||||||
|
|
|
@ -99,10 +99,10 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override var timeZone: String
|
override var timeZone: TimeZone
|
||||||
get() = podState.timeZone
|
get() = TimeZone.getTimeZone(podState.timeZone)
|
||||||
set(tz) {
|
set(tz) {
|
||||||
podState.timeZone = tz
|
podState.timeZone = tz.getDisplayName(true, TimeZone.SHORT)
|
||||||
store()
|
store()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -608,7 +608,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
|
||||||
// // return getSafe(() -> podState.getTimeZone());
|
// // return getSafe(() -> podState.getTimeZone());
|
||||||
// return podStateManager.timeZone
|
// return podStateManager.timeZone
|
||||||
// }
|
// }
|
||||||
private fun getTimeZone(): String {
|
private fun getTimeZone(): TimeZone {
|
||||||
// Return timezone ID (e.g "Europe/Amsterdam")
|
// Return timezone ID (e.g "Europe/Amsterdam")
|
||||||
return podStateManager.timeZone
|
return podStateManager.timeZone
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue