Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
17646ea
Merge pull request #9 from OpenLightingProject/master
peternewman Jul 18, 2018
89d50fa
Merge branch 'OpenLightingProject:master' into master
peternewman Jun 27, 2026
7279223
Update CI tasks in test.yml
peternewman Jun 27, 2026
9b793c0
Update test workflow to install nose conditionally
peternewman Jun 27, 2026
28a7dc5
Switch to pynose for more modern Python
peternewman Jun 27, 2026
6530b0b
Change nosetests dependency to pynose in workflow
peternewman Jun 27, 2026
5c14373
Merge branch 'nosetests' of https://github.com/peternewman/rdm-app in…
peternewman Jun 27, 2026
2178e13
Python 2 and 3 compatible version of execfile
peternewman Jun 27, 2026
cd8b781
Python 2 and 3 compatible URL checking
peternewman Jun 28, 2026
c45cebb
Update some manufacturer links
peternewman Jun 28, 2026
494c3c8
Add additional links to HTTP error handling test
peternewman Jun 28, 2026
e945c8c
Merge pull request #16 from peternewman/master
peternewman Jun 28, 2026
6445fec
Add NXP link to manufacturer test case
peternewman Jun 28, 2026
4db2ae3
Update manufacturer URLs for accuracy
peternewman Jun 28, 2026
67cce8c
Update a few more manufacturer websites
peternewman Jun 29, 2026
fc0aeda
Add new link to skip during manufacturer test
peternewman Jun 30, 2026
29eb495
Change assertion to allow response codes of 200 or 202
peternewman Jul 5, 2026
3d7a58a
Merge branch 'manufacturer-updates' of https://github.com/peternewman…
peternewman Jul 5, 2026
0897b21
Fix a syntax error
peternewman Jul 5, 2026
dfc61fd
Skip another URL
peternewman Jul 5, 2026
eed3831
Skip https://www.adamhall.com/ URL
peternewman Jul 5, 2026
cb11fcf
https://www.productionwarehouse.co.za/ is a different type of timeout…
peternewman Jul 5, 2026
1bbfa4c
Update a few manufacturer URLs in manufacturer_links.py
peternewman Sep 14, 2026
4a920b1
Merge branch 'master' into nosetests
peternewman Sep 14, 2026
fd0274f
Update manufacturer link for Fineline Solutions
peternewman Sep 14, 2026
d29f0a3
Comment out teamboyce.com entry in manufacturer_links
peternewman Sep 14, 2026
01da90e
Skip another working, but failing the tests, link
peternewman Sep 14, 2026
ce50bdc
Correct the error type we're skipping offstagecontrols against
peternewman Sep 14, 2026
ae61747
Skip Eldo LED in manufacturer test cases
peternewman Sep 14, 2026
eb31a34
Switch the model_data to hex for maximum compatibility
peternewman Sep 14, 2026
397b353
Merge branch 'master' into nosetests
peternewman Oct 1, 2026
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
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ jobs:
strategy:
fail-fast: false
matrix:
task: [data-check, codespell]
#spellintian, nosetests, karma, lint, closure-compiler,
task: [nosetests, data-check, codespell]
#spellintian, karma, lint, closure-compiler,
steps:
- uses: actions/checkout@master
- name: Install dependencies
env:
TASK: ${{ matrix.task }}
run: |
sudo apt-get update
if [ "$TASK" = "nosetests" ]; then pip install pynose; fi
if [ "$TASK" = "nosetests" -o "$TASK" = "flake8" -o "$TASK" = "flake8-wip" ]; then pip install json-spec; fi
if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then npm install -g grunt-cli; fi
if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then npm install; fi
Expand Down
3 changes: 2 additions & 1 deletion data/controller_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestControllerData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/controller_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
Comment thread
peternewman marked this conversation as resolved.
exec(open("data/controller_data.py").read(), globals, locals)
self.data = locals['CONTROLLER_DATA']

def test_ControllerData(self):
Expand Down
34 changes: 17 additions & 17 deletions data/manufacturer_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
(0x00A2, "http://www.empdesigns.co.uk/"),
(0x00A7, "https://www.syncronorm.com/"),
(0x00A8, "https://www.eye.co.jp/"),
(0x00A9, "http://www.richter-lt.de"),
(0x00B0, "http://www.arenaluci.com/"),
(0x00B9, "http://en.gzsjlight.com/"),
(0x00A9, "http://www.richter-lt.de/"),
(0x00B0, "https://arenaluci.it/en/"),
# (0x00B9, "http://en.gzsjlight.com/"), # Website currently gone
Comment thread
peternewman marked this conversation as resolved.
(0x0104, "https://www.blizzardpro.com/"),
(0x01CC, "https://portmanlights.com/"),
(0x01CD, "http://www.compulite.com/"),
Expand All @@ -52,7 +52,7 @@
(0x056B, "https://www.cosmolight.it/"),
(0x056C, "https://lumascape.com/"),
(0x05E0, "https://github.com/someweisguy/esp_dmx"),
(0x0609, "https://www.pierlite.com.au/diginet"),
(0x0609, "https://pierlite.com.au/our-brands/diginet"),
(0x06E4, "https://www.dydell.com/"),
(0x0710, "https://dts-lighting.it/"),
(0x074F, "https://www.panasonic.com/"),
Expand All @@ -70,11 +70,11 @@
(0x08A4, "https://www.adamhall.com/"),
(0x08A6, "https://impulswerk.de"),
(0x08EA, "https://www.cedarled.com/"),
(0x08C5, "https://ehrgeiz.glp.de/"),
# (0x08C5, "https://ehrgeiz.glp.de/"), # Now part of GLP
(0x0956, "https://www.expromo.eu/"),
(0x0957, "https://www.whitelight.ltd.uk/"),
(0x0960, "https://fineline.solutions/"),
(0x097A, "http://teamboyce.com/"),
(0x0960, "https://fineline.uk.com/"),
# (0x097A, "http://teamboyce.com/"), # Website has gone
(0x097F, "https://raumzeitlabor.de/"),
(0x0984, "https://www.laserworld.com/"),
(0x0987, "https://www.mathertel.de/"),
Expand Down Expand Up @@ -132,20 +132,20 @@
(0x4C52, "https://www.highend.com/"),
(0x4C53, "http://lss-lighting.de/"),
(0x4C55, "https://lumenradio.com/"),
(0x4C73, "http://www.lsclighting.com/"),
(0x4D41, "http://www.malighting.com/"),
(0x4C73, "https://www.lsccontrol.com.au/"),
(0x4D41, "https://www.malighting.com/"),
(0x4D44, "https://www.mdgfog.com/"),
(0x4D50, "http://www.martin.com/"),
(0x4D56, "http://www.avolites.com/"),
(0x4D50, "https://www.martin.com/"),
(0x4D56, "https://www.avolites.com/"),
(0x4F43, "https://www.offstagecontrols.com/"),
(0x5000, "http://www.orangepi-dmx.org"),
(0x5041, "http://www.lighting.philips.com/"),
(0x5075, "http://pulsarlight.com/"),
# (0x5075, "http://pulsarlight.com/"), # Website has gone
(0x5100, "https://www.luxibel.com/"),
(0x514D, "http://www.qmaxz.com/"),
(0x5168, "http://www.sunricher.com"),
# (0x514D, "http://www.qmaxz.com/"), # Website had gone
(0x5168, "https://www.sunricher.com"),
(0x5201, "https://www.crestron.com/"),
(0x5252, "http://www.rosco.com/"),
(0x5252, "https://www.rosco.com/"),
(0x5253, "https://www.robe.cz/"),
(0x5343, "https://www.oceaninsight.com/"),
(0x5344, "https://www.stardraw.com/"),
Expand All @@ -158,11 +158,11 @@
(0x544C, "http://tempest.biz/"),
(0x564C, "http://www.vari-lite.com/"),
(0x5753, "http://wirelessdmx.com"),
(0x5759, "https://www.wybron.com/"),
# (0x5759, "https://www.wybron.com/"), # Company, and website has gone
(0x586D, "http://www.doityourselfchristmas.com/"),
(0x6019, "https://artificers.co.uk/"),
(0x6205, "http://www.ltechonline.com/"),
(0x6364, "http://www.lanbox.com/"),
# (0x6364, "http://www.lanbox.com/"), # Website has gone
(0x646F, "https://www.eldoled.com/"),
(0x6555, "https://shanteacontrols.com/"),
(0x656C, "https://www.elclighting.com/"),
Expand Down
48 changes: 39 additions & 9 deletions data/manufacturer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,45 @@
# Copyright (C) 2015 Simon Newton

import unittest
import urllib2
import pprint
import sys
from socket import error as SocketError
from urllib2 import HTTPError
from urllib2 import URLError
from ssl import SSLError

if sys.version_info >= (3, 0):
try:
from urllib.request import build_opener
from urllib.request import HTTPCookieProcessor
from urllib.request import Request
from urllib.error import HTTPError
from urllib.error import URLError
except ImportError:
import urllib2
from urllib2 import build_opener
from urllib2 import HTTPCookieProcessor
from urllib2 import Request
from urllib2 import HTTPError
from urllib2 import URLError
else:
import urllib2
from urllib2 import build_opener
from urllib2 import HTTPCookieProcessor
from urllib2 import Request
from urllib2 import HTTPError
from urllib2 import URLError

class TestManufacturers(unittest.TestCase):
""" Test the manufacturer data files are valid."""
def setUp(self):
globals = {}
locals = {}
execfile("data/manufacturer_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/manufacturer_data.py").read(), globals, locals)
self.data = locals['MANUFACTURER_DATA']
globals = {}
locals = {}
execfile("data/manufacturer_links.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/manufacturer_links.py").read(), globals, locals)
self.links = locals['MANUFACTURER_LINKS']

def test_ManufacturerData(self):
Expand Down Expand Up @@ -68,7 +89,7 @@ def test_ManufacturerLinks(self):
esta_id, name = manufacturer_data
esta_ids.add(esta_id)

opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
opener = build_opener(HTTPCookieProcessor())

for manufacturer_link in self.links:
self.assertEqual(tuple, type(manufacturer_link))
Expand All @@ -94,7 +115,7 @@ def test_ManufacturerLinks(self):
ua = {'User-Agent': 'Mozilla/5.0 (KHTML, like Gecko)',
'referer': 'http://example.com'}

request = urllib2.Request(link, headers=ua)
request = Request(link, headers=ua)
response = opener.open(request)
except URLError as e:
if hasattr(e, 'reason'):
Expand All @@ -112,7 +133,16 @@ def test_ManufacturerLinks(self):
(type(e) is HTTPError and
(link == 'http://www.compulite.com/' or
link == 'https://www.lutron.com/en-US/Pages/default.aspx' or
link == 'https://www.panasonic.com/'))):
link == 'https://www.panasonic.com/' or
link == 'https://www.acuitybrands.com/' or
link == 'https://www.nxp.com/' or
link == 'https://www.martin.com/' or
link == 'https://portmanlights.com/' or
link == 'https://www.adamhall.com/' or
link == 'https://www.eldoled.com/')) or
(type(e) is URLError and
(link == 'https://www.productionwarehouse.co.za/' or
link == 'https://www.offstagecontrols.com/'))):
self.fail("Link %s failed due to %s, reason type: %s" % (link, e.reason, type(e)))
elif hasattr(e, 'code'):
self.fail("The server couldn't fulfill the request for %s. Error "
Expand All @@ -121,7 +151,7 @@ def test_ManufacturerLinks(self):
if hasattr(e, 'errno'):
self.fail("Link %s failed due to socket error %s" % (link, e.errno))
else:
self.assertEqual(response.code, 200,
self.assertTrue(((response.code == 200) or (response.code == 202)),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is an HTTP 307 also a success?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly, I guess depending on how temporary it is, we may or may not want to update their URL to the destination of the redirect (unless it's e.g. language/locale based). I've not hit any yet though...

"Failed to fetch URL %s got status %d" %
(link, response.code))

Expand Down
82 changes: 41 additions & 41 deletions data/model_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,47 @@
# Data for the device models.

DEVICE_MODEL_DATA = {
8482L: [{'device_model': 38,
'model_description': 'LED BAR',
'product_category': 1289,
'software_versions': {1: {'languages': [],
# 'label': 'V1.02 \x00LED BAR\x00BRITEQ',
'manufacturer_pids': [],
'personalities': [{'description': ' \x00\x08',
'index': 1,
'slot_count': 3},
{'description': ' \x00\x08',
'index': 2,
'slot_count': 4},
{'description': ' \x00\x08',
'index': 3,
'slot_count': 5},
{'description': ' \x00\x08',
'index': 4,
'slot_count': 6},
{'description': ' \x00\x08',
'index': 5,
'slot_count': 12},
{'description': ' \x00\x08',
'index': 6,
'slot_count': 15},
{'description': ' \x000',
'index': 7,
'slot_count': 16}],
'sensors': [{'description': 'Temperature',
'index': 0,
'supports_recording': 0,
'type': 0}],
'supported_parameters': [512,
513,
128,
129,
130,
224,
225,
1024]}},
'sub_device_count': 0}],
25711L: [{'device_model': 30,
0x2122: [{'device_model': 38,
'model_description': 'LED BAR',
'product_category': 1289,
'software_versions': {1: {'languages': [],
# 'label': 'V1.02 \x00LED BAR\x00BRITEQ',
'manufacturer_pids': [],
'personalities': [{'description': ' \x00\x08',
'index': 1,
'slot_count': 3},
{'description': ' \x00\x08',
'index': 2,
'slot_count': 4},
{'description': ' \x00\x08',
'index': 3,
'slot_count': 5},
{'description': ' \x00\x08',
'index': 4,
'slot_count': 6},
{'description': ' \x00\x08',
'index': 5,
'slot_count': 12},
{'description': ' \x00\x08',
'index': 6,
'slot_count': 15},
{'description': ' \x000',
'index': 7,
'slot_count': 16}],
'sensors': [{'description': 'Temperature',
'index': 0,
'supports_recording': 0,
'type': 0}],
'supported_parameters': [512,
513,
128,
129,
130,
224,
225,
1024]}},
'sub_device_count': 0}],
0x646F: [{'device_model': 30,
# 'model_description': 'LinearDC720W',
'product_category': 1289,
'software_versions': {254: {'label': '254',
Expand Down
3 changes: 2 additions & 1 deletion data/model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestDeviceModelData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/model_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/model_data.py").read(), globals, locals)
self.data = locals['DEVICE_MODEL_DATA']

def test_DeviceModelData(self):
Expand Down
3 changes: 2 additions & 1 deletion data/node_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestNodeData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/node_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/node_data.py").read(), globals, locals)
self.data = locals['NODE_DATA']

def test_NodeData(self):
Expand Down
3 changes: 2 additions & 1 deletion data/pid_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ class TestPidData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/pid_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/pid_data.py").read(), globals, locals)
self.manufacturer_pids = locals['MANUFACTURER_PIDS']
self.esta_pids = locals['ESTA_PIDS']
self.pid_validator = jsonspec.validators.load(PID_VALIDATOR)
Expand Down
3 changes: 2 additions & 1 deletion data/product_category_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestProductCategoryData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/product_categories.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/product_categories.py").read(), globals, locals)
self.data = locals['PRODUCT_CATEGORIES']

def test_ProductCategoryData(self):
Expand Down
3 changes: 2 additions & 1 deletion data/sensor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestSensorTypes(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/sensor_types.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/sensor_types.py").read(), globals, locals)
self.data = locals['SENSOR_TYPES']

def test_SensorTypeData(self):
Expand Down
3 changes: 2 additions & 1 deletion data/software_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestSoftwareData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/software_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/software_data.py").read(), globals, locals)
self.data = locals['SOFTWARE_DATA']

def test_SoftwareData(self):
Expand Down
3 changes: 2 additions & 1 deletion data/splitter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestSplitterData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/splitter_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/splitter_data.py").read(), globals, locals)
self.data = locals['SPLITTER_DATA']

def test_SplitterData(self):
Expand Down
6 changes: 4 additions & 2 deletions tools/missing_manufacturer_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ def Footer():
if __name__ == '__main__':
globals = {}
locals = {}
execfile("data/manufacturer_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/manufacturer_data.py").read(), globals, locals)
raw_manufacturers = locals['MANUFACTURER_DATA']
globals = {}
locals = {}
execfile("data/manufacturer_links.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/manufacturer_links.py").read(), globals, locals)
raw_links = locals['MANUFACTURER_LINKS']

manufacturers = {}
Expand Down
Loading