mirror of
https://github.com/home-assistant/android
synced 2024-07-22 10:54:12 +00:00
Fix expanded zone id for high accuracy zone constraint (#3509)
- When checking if an expanded zone geofence should be created include the server ID in the comparison as that is what is used everywhere else. Otherwise expanded zones are never added, and as a result high accuracy mode won't work as expected.
This commit is contained in:
parent
97634e3903
commit
7e1dc203ec
|
@ -947,7 +947,7 @@ class LocationSensorManager : LocationSensorManagerBase() {
|
|||
val configuredZones = getZones(serverId, forceRefresh = true)
|
||||
configuredZones.forEach {
|
||||
addGeofenceToBuilder(geofencingRequestBuilder, serverId, it)
|
||||
if (highAccuracyTriggerRange > 0 && highAccuracyZones.contains(it.entityId)) {
|
||||
if (highAccuracyTriggerRange > 0 && highAccuracyZones.contains("${serverId}_${it.entityId}")) {
|
||||
addGeofenceToBuilder(geofencingRequestBuilder, serverId, it, highAccuracyTriggerRange)
|
||||
}
|
||||
}
|
||||
|
@ -963,7 +963,7 @@ class LocationSensorManager : LocationSensorManagerBase() {
|
|||
zone: Entity<ZoneAttributes>,
|
||||
triggerRange: Int = 0
|
||||
) {
|
||||
val postRequestId = if (triggerRange > 0)"_expanded" else ""
|
||||
val postRequestId = if (triggerRange > 0) "_expanded" else ""
|
||||
geofencingRequestBuilder
|
||||
.addGeofence(
|
||||
Geofence.Builder()
|
||||
|
|
Loading…
Reference in a new issue