mirror of
https://github.com/JoelBender/bacpypes
synced 2025-09-28 22:15:23 +08:00
allow the property identifier in commands to be just an integer, it was inconsistent in the samples
This commit is contained in:
parent
f834e53c55
commit
47714a2df9
|
@ -548,6 +548,8 @@ class DiscoverConsoleCmd(ConsoleCmd):
|
|||
|
||||
devid = int(devid)
|
||||
obj_id = ObjectIdentifier(obj_id).value
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
datatype = get_datatype(obj_id[0], prop_id)
|
||||
if not datatype:
|
||||
|
|
|
@ -131,6 +131,8 @@ class ThreadedHTTPRequestHandler(SimpleHTTPRequestHandler):
|
|||
# implement a default property, the bain of committee meetings
|
||||
if len(args) == 3:
|
||||
prop_id = args[2]
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
else:
|
||||
prop_id = "presentValue"
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@ class ReadPropertyConsoleCmd(ConsoleCmd):
|
|||
try:
|
||||
addr, obj_id, prop_id = args[:3]
|
||||
obj_id = ObjectIdentifier(obj_id).value
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
datatype = get_datatype(obj_id[0], prop_id)
|
||||
if not datatype:
|
||||
|
|
|
@ -46,6 +46,8 @@ class ReadPropertyConsoleCmd(ConsoleCmd):
|
|||
try:
|
||||
addr, obj_id, prop_id = args[:3]
|
||||
obj_id = ObjectIdentifier(obj_id).value
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
datatype = get_datatype(obj_id[0], prop_id)
|
||||
if not datatype:
|
||||
|
|
|
@ -48,6 +48,8 @@ class ReadPropertyAnyConsoleCmd(ConsoleCmd):
|
|||
try:
|
||||
addr, obj_id, prop_id = args[:3]
|
||||
obj_id = ObjectIdentifier(obj_id).value
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
# build a request
|
||||
request = ReadPropertyRequest(
|
||||
|
|
|
@ -57,6 +57,8 @@ class ReadPropertyConsoleCmd(ConsoleCmd):
|
|||
try:
|
||||
addr, obj_id, prop_id = args[:3]
|
||||
obj_id = ObjectIdentifier(obj_id).value
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
datatype = get_datatype(obj_id[0], prop_id)
|
||||
if not datatype:
|
||||
|
|
|
@ -51,6 +51,8 @@ class ReadPropertyConsoleCmd(ConsoleCmd):
|
|||
try:
|
||||
addr, obj_id, prop_id = args[:3]
|
||||
obj_id = ObjectIdentifier(obj_id).value
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
datatype = get_datatype(obj_id[0], prop_id)
|
||||
if not datatype:
|
||||
|
|
|
@ -60,6 +60,8 @@ class ReadRangeConsoleCmd(ConsoleCmd):
|
|||
addr = Address(args.pop(0))
|
||||
obj_id = ObjectIdentifier(args.pop(0)).value
|
||||
prop_id = args.pop(0)
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
datatype = get_datatype(obj_id[0], prop_id)
|
||||
if not datatype:
|
||||
|
|
|
@ -51,6 +51,8 @@ class ReadWritePropertyConsoleCmd(ConsoleCmd):
|
|||
try:
|
||||
addr, obj_id, prop_id = args[:3]
|
||||
obj_id = ObjectIdentifier(obj_id).value
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
datatype = get_datatype(obj_id[0], prop_id)
|
||||
if not datatype:
|
||||
|
|
|
@ -51,9 +51,9 @@ class ReadWritePropertyConsoleCmd(ConsoleCmd):
|
|||
try:
|
||||
addr, obj_id, prop_id = args[:3]
|
||||
obj_id = ObjectIdentifier(obj_id).value
|
||||
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
if _debug: ReadWritePropertyConsoleCmd._debug(" - prop_id: %r", prop_id)
|
||||
|
||||
datatype = get_datatype(obj_id[0], prop_id, VendorAVObject.vendor_id)
|
||||
|
|
|
@ -52,6 +52,8 @@ class WriteLightingConsoleCmd(ConsoleCmd):
|
|||
try:
|
||||
addr, obj_id, prop_id = args[:3]
|
||||
obj_id = ObjectIdentifier(obj_id).value
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
datatype = get_datatype(obj_id[0], prop_id)
|
||||
if not datatype:
|
||||
|
|
|
@ -47,7 +47,8 @@ class WriteSomethingConsoleCmd(ConsoleCmd):
|
|||
try:
|
||||
addr, obj_id, prop_id = args[:3]
|
||||
obj_id = ObjectIdentifier(obj_id).value
|
||||
prop_id = int(prop_id)
|
||||
if prop_id.isdigit():
|
||||
prop_id = int(prop_id)
|
||||
|
||||
# build a request
|
||||
request = WritePropertyRequest(
|
||||
|
|
Loading…
Reference in New Issue
Block a user