mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Fix Tile location accuracy bug (#37233)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
856f8fd6de
commit
0f43476d03
@ -84,6 +84,11 @@ class TileDeviceTracker(TileEntity, TrackerEntity):
|
|||||||
|
|
||||||
Value in meters.
|
Value in meters.
|
||||||
"""
|
"""
|
||||||
|
state = self._tile["last_tile_state"]
|
||||||
|
h_accuracy = state.get("h_accuracy")
|
||||||
|
v_accuracy = state.get("v_accuracy")
|
||||||
|
|
||||||
|
if h_accuracy is not None and v_accuracy is not None:
|
||||||
return round(
|
return round(
|
||||||
(
|
(
|
||||||
self._tile["last_tile_state"]["h_accuracy"]
|
self._tile["last_tile_state"]["h_accuracy"]
|
||||||
@ -92,6 +97,14 @@ class TileDeviceTracker(TileEntity, TrackerEntity):
|
|||||||
/ 2
|
/ 2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if h_accuracy is not None:
|
||||||
|
return h_accuracy
|
||||||
|
|
||||||
|
if v_accuracy is not None:
|
||||||
|
return v_accuracy
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def latitude(self) -> float:
|
def latitude(self) -> float:
|
||||||
"""Return latitude value of the device."""
|
"""Return latitude value of the device."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user