File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ def started_connecting(self):
8888
8989 def connect_succeeded (self ):
9090 self .connected = True
91- logging .info ("Connecting succeeded!" )
91+ logging .info ("Connecting succeeded! Connected to Nuimo with firmware version %s" , self . get_firmware_version () )
9292
9393 def connect_failed (self , error ):
9494 logging .info ("Connecting just failed, anyhow reattempts will may do the job!" )
@@ -106,6 +106,18 @@ def attempt_reconnect(self):
106106 time .sleep (5 )
107107 self .nuimoMenue .reconnect ()
108108
109+ def get_firmware_version (self ):
110+ device_information_service = next (
111+ s for s in self .nuimoMenue .controller .services
112+ if s .uuid == '0000180a-0000-1000-8000-00805f9b34fb' )
113+
114+ firmware_version_characteristic = next (
115+ c for c in device_information_service .characteristics
116+ if c .uuid == '00002a26-0000-1000-8000-00805f9b34fb' )
117+ logging .info (firmware_version_characteristic .read_value ())
118+
119+ value = firmware_version_characteristic .read_value ()
120+ return bytes (value ).decode ('utf-8' )
109121
110122 def wheelNavigation (self , event ):
111123 valueChange = event .value / 30
You can’t perform that action at this time.
0 commit comments