This commit is contained in:
Tomas Krejci 2024-05-28 17:01:07 +02:00
parent 6cae2cd9af
commit 8f468ff531

View File

@ -78,9 +78,9 @@ log_level = logging.DEBUG
#log_level = logging.ERROR
logging.basicConfig(level=log_level, format='%(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
#PYTHONASYNCIODEBUG=1
### alive check ###
### Alive check ###
async def alive_check():
# loop for checked is alive
logger.debug("alive check start")
@ -89,7 +89,6 @@ async def alive_check():
while True:
logger.debug(f"running ms: {time.ticks_ms() - init_ticks}")
#print(f"main while running ms: {time.ticks_ms() - init_ticks}")
onboar_led.on()
await asyncio.sleep_ms(100)
onboar_led.off()
@ -111,8 +110,6 @@ async def olt_command(cmd, btn, rgb, ir_tx, tx1, tx2, tx3):
# IR TX send
logger.debug("Command {cmd} IR TX transmit")
asyncio.create_task(ir_tx.transmit(tx1, tx2, tx3, False))
#loop = asyncio.get_running_loop()
#loop.set_exception_handler(exception_handler)
await asyncio.sleep_ms(50)
await btn.release.wait()
logger.debug("Command {cmd} button released")