Skip to content

Commit

Permalink
Force update refresh after web-socket re-connect (#1151)
Browse files Browse the repository at this point in the history
* Force update refresh after web-socket re-connect

* [pre-commit.ci lite] apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
  • Loading branch information
springfall2008 and pre-commit-ci-lite[bot] authored May 29, 2024
1 parent cedd9ee commit f80069f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/predbat/predbat.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
if not "PRED_GLOBAL" in globals():
PRED_GLOBAL = {}

THIS_VERSION = "v7.20.5"
THIS_VERSION = "v7.20.6"
PREDBAT_FILES = ["predbat.py"]
TIME_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
TIME_FORMAT_SECONDS = "%Y-%m-%dT%H:%M:%S.%f%z"
Expand Down Expand Up @@ -5772,7 +5772,6 @@ def record_status(self, message, debug="", had_errors=False, notify=False, extra
},
)

self.log("Info: record_status {}".format(message + extra))
print("Info: record_status {}".format(message + extra))

self.previous_status = message
Expand Down Expand Up @@ -15113,6 +15112,7 @@ def update_time_loop(self, cb_args):
self.check_entity_refresh()
if self.update_pending and not self.prediction_started:
self.prediction_started = True
self.ha_interface.update_states()
self.load_user_config()
self.update_pending = False
try:
Expand Down Expand Up @@ -15252,6 +15252,7 @@ async def socketLoop(self):
sid += 1

self.log("Info: Web Socket active")
self.base.update_pending = True # Force an update when web-socket reconnects

async for message in websocket:
if self.base.stop_thread:
Expand Down

0 comments on commit f80069f

Please sign in to comment.