Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pv_excess_control.py #61

Merged
merged 3 commits into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PV_Excess_Control/pyscript/pv_excess_control.py
Maik7 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ def trigger_factory(self):
@time_trigger('period(now, 10s)')
def on_time():
# Sanity check
if not self.sanity_check():
if (not PvExcessControl.instances) or (not self.sanity_check()):
return on_time

# execute only if this the first instance of the dictionary (avoid two automations acting)
#log.info(f'{self.log_prefix} I am around.')
first_item = next(iter(PvExcessControl.instances.values()))
Expand Down