Skip to content

Commit

Permalink
🔧 Improve udev/systemd and requirements (#5)
Browse files Browse the repository at this point in the history
- udev rule to enable hot plugging
- systemd rule not needing to restart always
- requirements files for explicit dependency tracking in GitHub
  • Loading branch information
jerr0328 authored Apr 24, 2022
1 parent 3ac58c2 commit 5899adc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 90-co2mini.rules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ACTION=="remove", GOTO="co2mini_end"

SUBSYSTEMS=="usb", KERNEL=="hidraw*", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="a052", GROUP="plugdev", MODE="0660", SYMLINK+="co2mini%n", GOTO="co2mini_end"
SUBSYSTEMS=="usb", KERNEL=="hidraw*", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="a052", GROUP="plugdev", MODE="0660", SYMLINK+="co2mini%n", TAG+="systemd", ENV{SYSTEMD_WANTS}+="co2mini.service", GOTO="co2mini_end"

LABEL="co2mini_end"
2 changes: 1 addition & 1 deletion co2mini.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ User=pi
Type=idle
WorkingDirectory=/home/pi
ExecStart=/home/pi/.local/bin/co2mini /dev/co2mini0
Restart=always
Restart=on-failure
RestartSec=3
Environment=PYTHONUNBUFFERED=1

Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-c requirements.txt
black
build
flake8
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
HAP-Python
prometheus_client

0 comments on commit 5899adc

Please sign in to comment.