mirror of https://github.com/tuhiproject/tuhi.git
kete: use logger instead of plain prints for device notifications
parent
5a5a2bc2b8
commit
8e1bba496f
|
@ -140,11 +140,11 @@ class TuhiKeteDevice(_DBusObject):
|
||||||
|
|
||||||
def _on_signal_received(self, proxy, sender, signal, parameters):
|
def _on_signal_received(self, proxy, sender, signal, parameters):
|
||||||
if signal == 'ButtonPressRequired':
|
if signal == 'ButtonPressRequired':
|
||||||
print("{}: Press button on device now".format(self))
|
logger.info(f'{self}: Press button on device now')
|
||||||
elif signal == 'ListeningStopped':
|
elif signal == 'ListeningStopped':
|
||||||
err = parameters[0]
|
err = parameters[0]
|
||||||
if err < 0:
|
if err < 0:
|
||||||
print("{}: an error occured: {}".format(self, os.strerror(err)))
|
logger.error(f'{self}: an error occured: {os.strerror(err)}')
|
||||||
self.notify('listening')
|
self.notify('listening')
|
||||||
|
|
||||||
def _on_properties_changed(self, proxy, changed_props, invalidated_props):
|
def _on_properties_changed(self, proxy, changed_props, invalidated_props):
|
||||||
|
@ -168,7 +168,7 @@ class TuhiKeteDevice(_DBusObject):
|
||||||
for d in manager.devices:
|
for d in manager.devices:
|
||||||
if d.address == self.address:
|
if d.address == self.address:
|
||||||
self.is_pairing = False
|
self.is_pairing = False
|
||||||
print('{}: Pairing successful'.format(self))
|
logger.info(f'{self}: Pairing successful')
|
||||||
self.manager.quit()
|
self.manager.quit()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue