mirror of
https://github.com/JoelBender/bacpypes
synced 2025-09-28 22:15:23 +08:00
merge #160
This commit is contained in:
parent
83857fe94d
commit
d8703a4e57
|
@ -113,13 +113,15 @@ class LocalDeviceObject(CurrentPropertyListMixIn, DeviceObject):
|
|||
if 'objectIdentifier' not in kwargs:
|
||||
raise RuntimeError("objectIdentifier is required")
|
||||
|
||||
# coerce the object identifier
|
||||
object_identifier = kwargs['objectIdentifier']
|
||||
if isinstance(object_identifier, (int, long)):
|
||||
object_identifier = ('device', object_identifier)
|
||||
|
||||
# the object list is provided
|
||||
if 'objectList' in kwargs:
|
||||
raise RuntimeError("objectList is provided by LocalDeviceObject and cannot be overridden")
|
||||
else:
|
||||
kwargs['objectList'] = ArrayOf(ObjectIdentifier)([
|
||||
kwargs['objectIdentifier'],
|
||||
])
|
||||
kwargs['objectList'] = ArrayOf(ObjectIdentifier)([object_identifier])
|
||||
|
||||
# check for a minimum value
|
||||
if kwargs['maxApduLengthAccepted'] < 50:
|
||||
|
|
|
@ -114,13 +114,15 @@ class LocalDeviceObject(CurrentPropertyListMixIn, DeviceObject):
|
|||
if 'objectIdentifier' not in kwargs:
|
||||
raise RuntimeError("objectIdentifier is required")
|
||||
|
||||
# coerce the object identifier
|
||||
object_identifier = kwargs['objectIdentifier']
|
||||
if isinstance(object_identifier, (int, long)):
|
||||
object_identifier = ('device', object_identifier)
|
||||
|
||||
# the object list is provided
|
||||
if 'objectList' in kwargs:
|
||||
raise RuntimeError("objectList is provided by LocalDeviceObject and cannot be overridden")
|
||||
else:
|
||||
kwargs['objectList'] = ArrayOf(ObjectIdentifier)([
|
||||
kwargs['objectIdentifier'],
|
||||
])
|
||||
kwargs['objectList'] = ArrayOf(ObjectIdentifier)([object_identifier])
|
||||
|
||||
# check for a minimum value
|
||||
if kwargs['maxApduLengthAccepted'] < 50:
|
||||
|
|
|
@ -114,13 +114,15 @@ class LocalDeviceObject(CurrentPropertyListMixIn, DeviceObject):
|
|||
if 'objectIdentifier' not in kwargs:
|
||||
raise RuntimeError("objectIdentifier is required")
|
||||
|
||||
# coerce the object identifier
|
||||
object_identifier = kwargs['objectIdentifier']
|
||||
if isinstance(object_identifier, int):
|
||||
object_identifier = ('device', object_identifier)
|
||||
|
||||
# the object list is provided
|
||||
if 'objectList' in kwargs:
|
||||
raise RuntimeError("objectList is provided by LocalDeviceObject and cannot be overridden")
|
||||
else:
|
||||
kwargs['objectList'] = ArrayOf(ObjectIdentifier)([
|
||||
kwargs['objectIdentifier'],
|
||||
])
|
||||
kwargs['objectList'] = ArrayOf(ObjectIdentifier)([object_identifier])
|
||||
|
||||
# check for a minimum value
|
||||
if kwargs['maxApduLengthAccepted'] < 50:
|
||||
|
|
Loading…
Reference in New Issue
Block a user