JamZYM 6 luni în urmă
părinte
comite
cfd9fa6a00
1 a modificat fișierele cu 5 adăugiri și 4 ștergeri
  1. 5 4
      main.py

+ 5 - 4
main.py

@@ -13,12 +13,12 @@ from bleak import BleakClient,BleakScanner
 STM32_UUID = "00001101-0000-1000-8000-00805F9B34FB"
 
 class InfoWidget(Widget): 
-    def __init__(self, **kwargs):
-        super(InfoWidget, self).__init__(**kwargs)
-        self.size = (800,480)
-        asyncio.run(self.discover_devices())
+    # def __init__(self, **kwargs):
+    #     super(InfoWidget, self).__init__(**kwargs)
+        
 
     async def discover_devices(self):
+        self.size = (800,480)
         devices = await BleakScanner.discover()
         grid00 = GridLayout(cols=1,rows=2,width=self.width,height=self.height / 4)
         grid00.top = self.top
@@ -86,6 +86,7 @@ class InfoWidget(Widget):
 class STI2021A(App):
     def build(self):
         info = InfoWidget()
+        asyncio.run(info.discover_devices())
         # info.debug()
         return info