gpio close on shutdown

This commit is contained in:
marios8543 2025-04-26 20:41:13 +03:00
parent 44a70d3791
commit 8941c60ce5
2 changed files with 5 additions and 8 deletions

View File

@ -40,7 +40,7 @@ async def bluetooth_listener():
async def startup_event(): async def startup_event():
for i in [ for i in [
tunerlist.run(), tunerlist.run(),
bluetooth.run(), # bluetooth.run(),
tunerlist_listener(), tunerlist_listener(),
bluetooth_listener() bluetooth_listener()
]: ]:

View File

@ -71,10 +71,6 @@ class TunerList:
self.text = "" self.text = ""
self.preset = None self.preset = None
def __del__(self):
self.pi.bb_serial_read_close(GPIO_PIN)
self.pi.stop()
async def run(self): async def run(self):
try: try:
while True: while True:
@ -96,7 +92,8 @@ class TunerList:
print(hex(c), " ", end="") print(hex(c), " ", end="")
print(" [",self.text,"]", f" [P {self.preset}]") print(" [",self.text,"]", f" [P {self.preset}]")
except CancelledError: except CancelledError:
pass self.pi.bb_serial_read_close(GPIO_PIN)
self.pi.stop()
async def yield_new_state(self): async def yield_new_state(self):
while True: while True: