Replace @property with @GObject.property
Let's stick to just one for consistency
This commit is contained in:
parent
501c891a12
commit
9cecc1b535
|
@ -78,15 +78,15 @@ class TuhiDevice(GObject.Object):
|
|||
def paired(self, paired):
|
||||
self._paired = paired
|
||||
|
||||
@property
|
||||
@GObject.Property
|
||||
def name(self):
|
||||
return self._bluez_device.name
|
||||
|
||||
@property
|
||||
@GObject.Property
|
||||
def address(self):
|
||||
return self._bluez_device.address
|
||||
|
||||
@property
|
||||
@GObject.Property
|
||||
def dbus_device(self):
|
||||
return self._tuhi_dbus_device
|
||||
|
||||
|
|
10
tuhi/ble.py
10
tuhi/ble.py
|
@ -118,29 +118,29 @@ class BlueZDevice(GObject.Object):
|
|||
if self.connected:
|
||||
self.emit('connected')
|
||||
|
||||
@property
|
||||
@GObject.property
|
||||
def name(self):
|
||||
try:
|
||||
return self.interface.get_cached_property('Name').unpack()
|
||||
except AttributeError:
|
||||
return 'UNKNOWN'
|
||||
|
||||
@property
|
||||
@GObject.property
|
||||
def address(self):
|
||||
return self.interface.get_cached_property('Address').unpack()
|
||||
|
||||
@property
|
||||
@GObject.property
|
||||
def uuids(self):
|
||||
return self.interface.get_cached_property('UUIDs').unpack()
|
||||
|
||||
@property
|
||||
@GObject.property
|
||||
def vendor_id(self):
|
||||
md = self.interface.get_cached_property('ManufacturerData')
|
||||
if md is not None:
|
||||
return md.keys()[0]
|
||||
return None
|
||||
|
||||
@property
|
||||
@GObject.property
|
||||
def connected(self):
|
||||
return (self.interface.get_cached_property('Connected').unpack() and
|
||||
self.interface.get_cached_property('ServicesResolved').unpack())
|
||||
|
|
|
@ -40,7 +40,7 @@ class TuhiConfig(GObject.Object):
|
|||
self._devices = {}
|
||||
self._scan_config_dir()
|
||||
|
||||
@property
|
||||
@GObject.property
|
||||
def devices(self):
|
||||
'''
|
||||
Returns a dictionary with the bluetooth address as key
|
||||
|
|
|
@ -88,7 +88,7 @@ class Drawing(GObject.Object):
|
|||
|
||||
# The way we're building drawings, we don't need to change the current
|
||||
# stroke at runtime, so this is read-ony
|
||||
@property
|
||||
@GObject.property
|
||||
def current_stroke(self):
|
||||
return self.strokes[self._current_stroke]
|
||||
|
||||
|
|
Loading…
Reference in New Issue