From d10b536637dd43557af93de105fba0733d74e630 Mon Sep 17 00:00:00 2001 From: Jevgeni Kiski Date: Thu, 9 Apr 2020 18:29:34 +0300 Subject: [PATCH] 1.4.0. Run "bkcmd=3" on device startup. --- nextion/client.py | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nextion/client.py b/nextion/client.py index 443c842..9af2f86 100644 --- a/nextion/client.py +++ b/nextion/client.py @@ -42,6 +42,9 @@ def __init__( self._sleeping = True self.sets_todo = {} + async def on_startup(self): + await self.command("bkcmd=3") # Let's ensure we receive expected responses + async def on_wakeup(self): await asyncio.sleep( TIME_TO_RECOVER_FROM_SLEEP @@ -77,6 +80,7 @@ def event_message_handler(self, message): self._loop.create_task(self.on_wakeup()) self.event_handler(EventType(typ), None) elif typ == EventType.STARTUP: # System successful start up + self._loop.create_task(self.on_startup()) self.event_handler(EventType(typ), None) elif typ == EventType.SD_CARD_UPGRADE: # Start SD card upgrade self.event_handler(EventType(typ), None) diff --git a/setup.py b/setup.py index 46d4d51..dea4536 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ def read(filename, parent=None): setup( name="nextion", - version="1.3.1", + version="1.4.0", packages=find_packages(exclude=["tests", "tests.*"]), python_requires=">=3.5.1, <4", license="LGPL 3",