Skip to content

Commit

Permalink
Update ble_gateway.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH committed Jun 28, 2024
1 parent 6bbe43f commit 0e39b3d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions TheengsGateway/ble_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,10 @@ def check_tracker_timeout(self) -> None:
if (
round(time()) - time_model.time >= self.configuration["tracker_timeout"]
and time_model.time != 0
and (
self.configuration["discovery"]
or self.configuration["general_presence"]
)
):
if (
time_model.model_id in ("APPLEWATCH", "APPLEDEVICE")
and not self.configuration["discovery"]
and self.configuration["general_presence"]
):
message = json.dumps(
{"id": address, "presence": "absent", "unlocked": False}
Expand All @@ -415,8 +411,10 @@ def check_tracker_timeout(self) -> None:
+ "/"
+ address.replace(":", ""),
)

time_model.time = 0
self.discovered_trackers[address] = time_model

logger.info("[TO] Discovered Trackers: %s", self.discovered_trackers)

async def ble_scan_loop(self) -> None:
Expand Down

0 comments on commit 0e39b3d

Please sign in to comment.