Skip to content

Commit

Permalink
Added bacnet.read_priority_array() as a shortcut to have all the resu…
Browse files Browse the repository at this point in the history
…lt easily
  • Loading branch information
ChristianTremblay committed Feb 21, 2020
1 parent f823265 commit ff63714
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions BAC0/core/io/Read.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,17 @@ def readRange(self, args, arr_index=None, vendor_id=0, bacoid=None, timeout=10):
"APDU Abort Reason : {}".format(reason)
)

def read_priority_array(self, addr, obj, obj_instance):
pa = self.read("{} {} {} priorityArray".format(addr, obj, obj_instance))
res = []
res.append(pa)
for each in range(1, 17):
_pa = pa[each]
for k, v in _pa.__dict__.items():
if v != None:
res.append(v)
return res


def find_reason(apdu):
try:
Expand Down
2 changes: 1 addition & 1 deletion BAC0/infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
__email__ = "christian.tremblay@servisys.com"
__url__ = "https://github.com/ChristianTremblay/BAC0"
__download_url__ = "https://github.com/ChristianTremblay/BAC0/archive/master.zip"
__version__ = "20.02.20"
__version__ = "20.02.21dev"
__license__ = "LGPLv3"

0 comments on commit ff63714

Please sign in to comment.