Skip to content

Commit

Permalink
OSM: implement cost description
Browse files Browse the repository at this point in the history
  • Loading branch information
johan12345 committed Jul 9, 2023
1 parent 5e26cc6 commit 930a5ef
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ data class OSMChargingStation(
return null
}

private fun getCost(): Cost? {
private fun getCost(): Cost {
val freecharging = when (tags["fee"]?.lowercase()) {
"yes", "y" -> false
"no", "n" -> true
Expand All @@ -182,7 +182,9 @@ data class OSMChargingStation(
"yes", "y", "interval" -> false
else -> null
}
return Cost(freecharging, freeparking)
val description = listOfNotNull(tags["charge"], tags["charge:conditional"]).ifEmpty { null }
?.joinToString("\n")
return Cost(freecharging, freeparking, null, description)
}

companion object {
Expand Down

0 comments on commit 930a5ef

Please sign in to comment.