Skip to content

Commit

Permalink
ha - change ratio for full open state
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Aug 25, 2024
1 parent ad36220 commit b6c7a42
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ph4ha/apps/blinds.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,17 @@ def on_pre_dusk_recompute(self):
try:
total_offset = datetime.timedelta(hours=self.pre_dusk_offset.hour - 12, minutes=self.pre_dusk_offset.minute)
time_diff = (
datetime.datetime(
year=2000, day=1, month=1, hour=self.next_dusk_time.hour, minute=self.next_dusk_time.minute
(
datetime.datetime(
year=2000, day=1, month=1, hour=self.next_dusk_time.hour, minute=self.next_dusk_time.minute
)
- datetime.datetime(
year=2000, day=1, month=1, hour=self.next_noon_time.hour, minute=self.next_noon_time.minute
)
)
- datetime.datetime(
year=2000, day=1, month=1, hour=self.next_noon_time.hour, minute=self.next_noon_time.minute
)
) / 2
* 2
/ 3
)
adjusted_pre_dusk_time = self.next_noon_time + time_diff + total_offset
self.log(f"Scheduling event for pre-dusk at {adjusted_pre_dusk_time}, {total_offset=}, {time_diff=}.")

Expand Down

0 comments on commit b6c7a42

Please sign in to comment.