Fix dialog options for high accuracy zone constraint entity id (#3508)

Fix dialog for high accuracy zone constraint entity id

 - Zone entity ids can contain underscores, only split on underscores once to keep those that belong to the entity id (string is serverid_entityid). The data was being stored correctly.
This commit is contained in:
Joris Pelgröm 2023-05-13 04:43:01 +02:00 committed by GitHub
parent 87042137a4
commit 97634e3903
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -394,7 +394,7 @@ class SensorDetailViewModel @Inject constructor(
.filter { entries == null || entries.contains(it) }
.map {
val server = servers.first { s -> s.id == it.split("_")[0].toInt() }
val zone = it.split("_")[1]
val zone = it.split("_", limit = 2)[1]
if (servers.size > 1) "${server.friendlyName}: $zone" else zone
}
val entriesNotInZones = entries