Skip to content

Commit 43d8d80

Browse files
committed
Move home test to subdirectory and add service
1 parent f145d68 commit 43d8d80

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

tests/home/PyDMXControl.service

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[Unit]
2+
Description=PyDMXControl
3+
After=syslog.target network.target
4+
5+
[Service]
6+
User=pi
7+
Group=pi
8+
9+
Restart=always
10+
RestartSec=30
11+
12+
Type=idle
13+
WorkingDirectory=/home/pi/PyDMXControl/tests
14+
ExecStart=python3 launch.py home/home.py
15+
16+
[Install]
17+
WantedBy=multi-user.target
File renamed without changes.

tests/home.py renamed to tests/home/home.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
from typing import List, Dict, Callable
55

66
from PyDMXControl import Colors
7-
from PyDMXControl.controllers import uDMXController as Controller
7+
from PyDMXControl.controllers import OpenDMXController as Controller
88
from PyDMXControl.effects.Color import Color_Chase
99
from timed_events_data import get_timed_events
1010

1111
# This is my home setup, which also acts as a great demo of some of what this library is capable of doing.
1212
# See the tests directory for other recent/new features that I've possibly been working on.
1313

1414
# Create our controller
15-
dmx = Controller(dynamic_frame=True)
15+
dmx = Controller(dynamic_frame=True, suppress_ticker_behind_warnings=True)
1616

1717
# Load some fixtures from JSON
18-
dmx.json.load_config('json/home.json')
18+
dmx.json.load_config('home/home.json')
1919

2020
# Define some custom colors, a global fade time and the divoom device
2121
custom_blue = [0, 16, 255, 0]

tests/launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def run():
4040

4141
if __name__ == "__main__":
4242
if len(sys.argv) == 1:
43-
sys.argv.append("home.py")
43+
raise SyntaxError("Expected script to run as first argument")
4444

4545
print("Need to create environment:", not os.path.exists("./venv"))
4646
if not os.path.exists("./venv"):

0 commit comments

Comments
 (0)