1
0
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:
Joel Bender 2020-11-04 10:13:32 -05:00
parent f834e53c55
commit 47714a2df9
12 changed files with 23 additions and 2 deletions

View File

@ -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:

View File

@ -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"

View File

@ -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:

View File

@ -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:

View File

@ -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(

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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)

View File

@ -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:

View File

@ -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(