本文整理匯總了Python中bacpypes.app.LocalDeviceObject._dict_contents方法的典型用法代碼示例。如果您正苦於以下問題:Python LocalDeviceObject._dict_contents方法的具體用法?Python LocalDeviceObject._dict_contents怎麽用?Python LocalDeviceObject._dict_contents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bacpypes.app.LocalDeviceObject
的用法示例。
在下文中一共展示了LocalDeviceObject._dict_contents方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: RandomAnalogValueObject
# 需要導入模塊: from bacpypes.app import LocalDeviceObject [as 別名]
# 或者: from bacpypes.app.LocalDeviceObject import _dict_contents [as 別名]
this_device.protocolServicesSupported = services_supported.value
# make a random input object
ravo1 = RandomAnalogValueObject(
objectIdentifier=('analogValue', 1), objectName='Random1'
)
_log.debug(" - ravo1: %r", ravo1)
ravo1d = ravo1._dict_contents()
print ravo1d
ravo2 = RandomAnalogValueObject(
objectIdentifier=('analogValue', 2), objectName='Random2'
)
_log.debug(" - ravo2: %r", ravo2)
# add it to the device
this_application.add_object(ravo1)
this_application.add_object(ravo2)
_log.debug(" - object list: %r", this_device.objectList)
print this_device._dict_contents()
run()
except Exception, e:
_log.exception("an error has occurred: %s", e)
finally:
_log.debug("finally")
示例2: RandomAnalogValueObject
# 需要導入模塊: from bacpypes.app import LocalDeviceObject [as 別名]
# 或者: from bacpypes.app.LocalDeviceObject import _dict_contents [as 別名]
this_device.protocolServicesSupported = services_supported.value
# make a random input object
ravo1 = RandomAnalogValueObject(
objectIdentifier=('analogValue', 1), objectName='Random1'
)
_log.debug(" - ravo1: %r", ravo1)
ravo1d = ravo1._dict_contents()
print(ravo1d)
ravo2 = RandomAnalogValueObject(
objectIdentifier=('analogValue', 2), objectName='Random2'
)
_log.debug(" - ravo2: %r", ravo2)
# add it to the device
this_application.add_object(ravo1)
this_application.add_object(ravo2)
_log.debug(" - object list: %r", this_device.objectList)
print(this_device._dict_contents())
run()
except Exception as error:
_log.exception("an error has occurred: %s", error)
finally:
_log.debug("finally")