Skip to content

Commit

Permalink
Merge pull request #200 from Snuffy2/Set-tracking-updates-throttle
Browse files Browse the repository at this point in the history
Set tracking updates throttle to 10 seconds
  • Loading branch information
Snuffy2 authored Aug 25, 2023
2 parents 2d64ad8 + 3047c55 commit 7b9dbd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/places/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
use_issue_reg = False

THROTTLE_INTERVAL = timedelta(seconds=600)
MIN_THROTTLE_INTERVAL = timedelta(seconds=10)
SCAN_INTERVAL = timedelta(seconds=30)
PLACES_JSON_FOLDER = os.path.join("custom_components", DOMAIN, "json_sensors")
try:
Expand Down Expand Up @@ -703,6 +704,7 @@ def is_devicetracker_set(self):
# _LOGGER.debug(f"({self.get_attr(CONF_NAME)}) [is_devicetracker_set] Devicetracker is not set")
return False

@Throttle(MIN_THROTTLE_INTERVAL)
def tsc_update(self, tscarg=None):
"""Call the do_update function based on the TSC (track state change) event"""
if self.is_devicetracker_set():
Expand Down

0 comments on commit 7b9dbd1

Please sign in to comment.