gpio close on shutdown
This commit is contained in:
parent
44a70d3791
commit
8941c60ce5
@ -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()
|
||||||
]:
|
]:
|
||||||
|
@ -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,12 +92,13 @@ 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:
|
||||||
yield await self.queue.get()
|
yield await self.queue.get()
|
||||||
|
|
||||||
async def send_button(self, btn):
|
async def send_button(self, btn):
|
||||||
with ThreadPoolExecutor() as executor:
|
with ThreadPoolExecutor() as executor:
|
||||||
loop = get_event_loop()
|
loop = get_event_loop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user