Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Preliminary support for ComNav UC331 #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ultrasync/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class NX595EVendor(object):
# xGen8 UltraSync
XGEN8 = 'xgen8'

# uc331 ComNav UltraSync
COMNAV_UC3 = 'comnav-uc3'


class XGZWPanelFunction(object):
"""
Expand Down
10 changes: 9 additions & 1 deletion ultrasync/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,12 @@ def login(self):
# However, XGen8 use:
# - /javascript
# - /xGen __ Secure Network_file

# Comnav device:
# - uc331/v_uc331_0.226/scripts/controllers/lang.js
#
match = re.search(
r'script src="(?P<path>/(v_(?P<vendor>[^_]+)'
r'script src=["\'](?P<cn3guc>uc[0-9]+)?(?P<path>/(v_(?P<vendor>[^_]+)'
r'_0?(?P<version>[0-9]\.[0-9.]*)(-(?P<release>[^/]+))?'
r'|(?P<xgen8>(xGen __ Secure Network_files|javascript)))).*',
response, re.M)
Expand Down Expand Up @@ -210,6 +213,11 @@ def login(self):
self.version = match.group('version')
self.release = match.group('release')

elif match.group('vendor') == 'uc331':
self.vendor = NX595EVendor.COMNAV_UC3
self.version = match.group('version')
self.release = match.group('release')

else:
logger.error(
'Unsupported vendor {}'.format(match.group('vendor')))
Expand Down
Loading