dash ble: use .let(Id::fromLong)

https://github.com/0pen-dash/AndroidAPS/pull/21#pullrequestreview-610227073
This commit is contained in:
Andrei Vereha 2021-03-11 23:06:00 +01:00
parent 27e9b25e86
commit 0396b9ca99

View file

@ -49,7 +49,7 @@ class OmnipodDashBleManagerImpl @Inject constructor(
private var status: ConnectionStatus = ConnectionStatus.IDLE
private val myId = Id.fromInt(CONTROLLER_ID)
private val uniqueId = podState.uniqueId
private val podId = uniqueId?.let { Id.fromLong(uniqueId) }
private val podId = uniqueId?.let(Id::fromLong)
?: myId.increment() // pod not activated
@Throws(