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 Feb 13, 2024
1 parent 685d7d8 commit 3a39d5f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions TheengsGateway/ble_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ def check_tracker_timeout(self) -> None:
# Publish offline message
for address, timemodeldict in self.discovered_trackers.copy().items():
if (
round(time()) - timemodeldict[0]
round(time()) - int(timemodeldict[0])
>= self.configuration["tracker_timeout"]
and timemodeldict[0] != 0
and int(timemodeldict[0]) != 0
and (
self.configuration["discovery"]
or self.configuration["general_presence"]
Expand All @@ -378,7 +378,7 @@ def check_tracker_timeout(self) -> None:
)
tup1 = list(timemodeldict)
tup1[0] = 0
self.discovered_trackers[address] = tuple(tup1)
self.discovered_trackers[address] = dict(tup1)

async def ble_scan_loop(self) -> None:
"""Scan for BLE devices."""
Expand Down Expand Up @@ -588,7 +588,7 @@ def publish_json(
+ get_address(data_json).replace(":", ""),
)
self.discovered_trackers[str(data_json["id"])] = (
round(time()),
int(round(time())),
str(data_json["model_id"]),
)
logger.debug("Discovered Trackers: %s", self.discovered_trackers)
Expand Down

0 comments on commit 3a39d5f

Please sign in to comment.