getEvseGroups

fun Location.getEvseGroups(connectorTypes: List<String> = emptyList(), powerRangeKw: IntRange = 0..Int.MAX_VALUE): List<EvseGroup>

Returns a list of EvseGroup objects representing the availability of EVSE grouped by their maximum output power in kW.

Each EVSE is included only if it has at least one connector of the specified types (or all connectors if connectorTypes is empty) and the maximum power falls within the specified range. The maximum power is calculated as the highest power among all matching connectors in the EVSE.

The list is sorted in descending order by power (from highest to lowest power).

Example return value:

listOf(
EvseGroup(maxPowerKw = 250, availableCount = 0, totalCount = 1),
EvseGroup(maxPowerKw = 150, availableCount = 1, totalCount = 2),
EvseGroup(maxPowerKw = 50, availableCount = 2, totalCount = 4),
)

Parameters

connectorTypes

List of connector types to filter by. If empty, includes all EVSE. Default: emptyList().

powerRangeKw

Range of output power in kW to filter EVSE by their maximum power. Default: 0..Int.MAX_VALUE (no filtering).