How about DeviceExists method (like here):
if device.PropertyExists('info.product'):
return device.GetProperty('info.product')
return "unknown"
And PropertyModified signal, (ex from real world):
#
# _CBHalDeviceConnected
#
# INTERNAL
#
# Callback triggered when a device is connected through Hal.
#
def _CBHalDeviceConnected(self, obj_path):
...
self.device.connect_to_signal("PropertyModified",
self._CBHalDeviceAuthStateChanged)
...
#
# _CBHalDeviceAuthStateChanged
#
# INTERNAL
#
# Callback triggered when a Hal device property is changed,
# for checking authorization state changes
#
def _CBHalDeviceAuthStateChanged(self,num_changes,properties):
for property in properties:
property_name, added, removed = property
if property_name == "pda.pocketpc.password":
self.logger.info("_CBHalDeviceAuthStateChanged:
device authorization state changed: reauthorizing")
self._ProcessAuth()
HAL 0.5.10 Specification
D-Bus Specification
D-Bus Tutorial