Charging network settings
The Navigation SDK UX Framework allows setting the list of available charging station networks as well as the networks preferred by the user. Additionally, the SDK allows listening for changes in selected charging networks, enabling you to respond to changes in user preferences.
To set list of available charging station networks you need to pass list of ChargingNetwork
s:
Dash.controller.userSettings.chargingNetworkSettings.setAll(
listOf(
ChargingNetwork(id = "chargepoint", name = "ChargePoint"),
ChargingNetwork(id = "blink", name = "Blink"),
ChargingNetwork(id = "electrify_america", name = "Electrify America"),
ChargingNetwork(id = "evgo", name = "EVgo"),
),
)
To mark some networks as preferred you need to pass set of networks IDs like:
Dash.controller.userSettings.chargingNetworkSettings.setPreferred(
setOf(
"chargepoint",
"evgo",
),
)
To subscribe to the preferred networks changes that user can make via the Settings UI:
Dash.controller.userSettings.chargingNetworkSettings.observePreferred()
.collect { ids ->
Log.i(TAG, "Preferred network IDs: ids")
}
この{Type}は役に立ちましたか?