Skip to content

Commit

Permalink
- revert 'expired' variable calculation logic in set_characteristics
Browse files Browse the repository at this point in the history
  • Loading branch information
kormax committed Oct 8, 2023
1 parent 3e6ba0b commit 2568f9b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyhap/accessory_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,11 @@ def set_characteristics(self, chars_query, client_addr):
updates_by_accessories_services = {}
char_to_iid = {}

expired = False
pid = chars_query.get(HAP_REPR_PID, None)
expire_time = self.prepared_writes.get(client_addr, {}).pop(pid, None)
expired = False if pid is None else expire_time is None or time.time() > expire_time
if pid is not None:
expire_time = self.prepared_writes.get(client_addr, {}).pop(pid, None)
expired = expire_time is None or time.time() > expire_time

to_update = (query for query in queries if HAP_REPR_VALUE in query or expired)
for query in to_update:
Expand Down

0 comments on commit 2568f9b

Please sign in to comment.