JamZYM 6 hónapja
szülő
commit
aa2c57c706
1 módosított fájl, 3 hozzáadás és 3 törlés
  1. 3 3
      main.py

+ 3 - 3
main.py

@@ -5,7 +5,7 @@ from kivy.uix.gridlayout import GridLayout
 from kivy.uix.label import Label
 from kivy.uix.textinput import TextInput
 from kivy.lang import Builder
-# import asyncio
+import asyncio
 # from bleak import BleakClient,BleakScanner
 
 # import json
@@ -17,7 +17,7 @@ class InfoWidget(Widget):
     #     super(InfoWidget, self).__init__(**kwargs)
         
 
-    def discover_devices(self):
+    async def discover_devices(self):
         self.size = (800,480)
         grid00 = GridLayout(cols=1,rows=2,width=self.width,height=self.height / 4)
         grid00.top = self.top
@@ -85,7 +85,7 @@ class InfoWidget(Widget):
 class STI2021A(App):
     def build(self):
         info = InfoWidget()
-        info.discover_devices()
+        asyncio.run(info.discover_devices())
         # info.debug()
         return info