Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH committed Jan 8, 2024
1 parent 84d994e commit 0620576
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions TheengsGateway/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ def publish_device_tracker(
def copy_pub_device(self, device: dict) -> dict:
"""Copy pub_device and remove "track" if publish_advdata is false."""
# Remove "track" if PUBLISH_ADVDATA is 0
if not self.configuration["publish_advdata"] and "track" in device:
device.pop("track", None)
pub_device_copy = device.copy()
if not self.configuration["publish_advdata"] and "track" in pub_device_copy:
pub_device_copy.pop("track", None)

return device
return pub_device_copy

0 comments on commit 0620576

Please sign in to comment.