Skip to content
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
8 changes: 8 additions & 0 deletions apps/predbat/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,10 @@ def write_and_poll_switch(self, name, entity_id, new_value):
def write_and_poll_value(self, name, entity_id, new_value, fuzzy=0, ignore_fail=False, required_unit=None):
# Modified to cope with sensor entities and writing strings
# Re-written to minimise writes
if not entity_id:
self.base.log("Warn: Inverter {} write_and_poll_value: No entity_id for {} to write {}".format(self.id, name, new_value))
self.base.record_status("Warn: Inverter {} write_and_poll_value: No entity_id for {} to write {}".format(self.id, name, new_value), had_errors=True)
return False
domain, entity_name = entity_id.split(".")
current_state = self.base.get_state_wrapper(entity_id, required_unit=required_unit)

Expand Down Expand Up @@ -1523,6 +1527,10 @@ def write_and_poll_option(self, name, entity_id, new_value, ignore_fail=False):
"""
GivTCP Workaround, keep writing until correct
"""
if not entity_id:
self.base.log("Warn: Inverter {} write_and_poll_option: No entity_id for {} to write {}".format(self.id, name, new_value))
self.base.record_status("Warn: Inverter {} write_and_poll_option: No entity_id for {} to write {}".format(self.id, name, new_value), had_errors=True)
return False
entity_base = entity_id.split(".")[0]

if entity_base not in ["input_select", "select", "time"]:
Expand Down