Skip to content

Commit

Permalink
Update last run timestamp on correct objects
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremysherriff authored Jan 3, 2025
1 parent 0d8be0d commit 4e4f057
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lnxlink/modules/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ def get_info(self):
if discovery.get("type") == "sensor":
cur_time = time.time()
if cur_time - discovery["last_time"] > discovery["update_interval"]:
self.discovery_info[expose_name]["last_time"] = cur_time
discovery["last_time"] = cur_time
stdout, _, returncode = syscommand(discovery["local_command"])
if returncode == 0:
self.lnxlink.run_module(f"{self.name}/{expose_name}", stdout)
elif discovery.get("type") == "binary_sensor":
cur_time = time.time()
if cur_time - discovery["last_time"] > discovery["update_interval"]:
self.discovery_info[expose_name]["last_time"] = cur_time
discovery["last_time"] = cur_time
stdout, _, _ = syscommand(discovery["local_command"])
status = stdout.lower() not in ["false", "no", "0", ""]
senddata = {
Expand Down

0 comments on commit 4e4f057

Please sign in to comment.