Skip to content

Commit

Permalink
slow down settings/door status retrieval.
Browse files Browse the repository at this point in the history
  • Loading branch information
corporategoth committed Feb 28, 2022
1 parent 4133dc4 commit 165cbc5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions custom_components/powerpetdoor/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ def connection_made(self, transport):
_LOGGER.info("Connection Successful!")
self._transport = transport
self._keepalive = asyncio.ensure_future(self.keepalive(), loop=self._eventLoop)
self.send_message(CONFIG, "GET_DOOR_STATUS")
self.send_message(CONFIG, "GET_SETTINGS")

def connection_lost(self, exc):
Expand Down Expand Up @@ -301,7 +300,7 @@ def process_message(self, msg):

self.settings = msg["settings"]
_LOGGER.info("DOOR SETTINGS - {}".format(json.dumps(self.settings)))
self.schedule_update_ha_state()
self.schedule_update_ha_state(self.status is None)
self._refresh = asyncio.ensure_future(self.refresh(), loop=self._eventLoop)

if msg["CMD"] in ("GET_SENSORS", "ENABLE_INSIDE", "DISABLE_INSIDE", "ENABLE_OUTSIDE", "DISABLE_OUTSIDE"):
Expand Down

0 comments on commit 165cbc5

Please sign in to comment.