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 24, 2024
1 parent e456d3b commit 8e5f850
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions TheengsGateway/ble_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,16 @@ def on_message(client, userdata, msg) -> None: # noqa: ANN001,ARG001
if (
msg_json["gatewayid"] != self.configuration["gateway_id"]
and msg_json["tracker"] in self.discovered_trackers
and self.discovered_trackers[msg_json["tracker"]].time != 0
):
self.discovered_trackers[msg_json["tracker"]].time = 0
logger.info("Tracker %s disassociated", msg_json["tracker"])
logger.info(
"Tracker %s disassociated by gateway %s",
msg_json["tracker"],
msg_json["gatewayid"],
)

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

else:
logger.info(
Expand Down Expand Up @@ -632,7 +637,7 @@ def publish_json(
round(time()),
str(data_json["model_id"]),
)
logger.debug("Discovered Trackers: %s", self.discovered_trackers)
logger.info("Discovered Trackers: %s", self.discovered_trackers)

# Remove "track" if PUBLISH_ADVDATA is 0
if not self.configuration["publish_advdata"] and "track" in data_json:
Expand Down

0 comments on commit 8e5f850

Please sign in to comment.