]> git.gag.com Git - fw/quantimotor/commitdiff
fix filename typo
authorBdale Garbee <bdale@gag.com>
Thu, 24 Jul 2025 23:27:06 +0000 (17:27 -0600)
committerBdale Garbee <bdale@gag.com>
Thu, 24 Jul 2025 23:27:06 +0000 (17:27 -0600)
debian/quantimotor.install
power-button,py [deleted file]
power-button.py [new file with mode: 0755]

index 969e9fb8010da3a189da62cd333c21a22f614d1b..57a9d2f3c4d11f96b8fc72edacc11470584856ed 100644 (file)
@@ -1,7 +1,7 @@
 ui/* usr/share/quantimotor/ui
 bcm2837-rpi-zero-2-w.dtb usr/share/quantimotor
 enable_ads.py usr/share/quantimotor
-power-button,py usr/share/quantimotor
+power-button.py usr/share/quantimotor
 power-off.py usr/lib/systemd/system-shutdown
 quantimotor.conf etc/modules-load.d
 raspi-extra-cmdline etc/default
diff --git a/power-button,py b/power-button,py
deleted file mode 100755 (executable)
index 584e0ac..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/python3
-# -*- coding: utf-8 -*-
-#
-# Power button watcher to initiate system shutdown
-# Copyright (C) 2025 Bdale Garbee <bdale@gag.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program.  If not, see <https://www.gnu.org/licenses/>.
-#
-
-import gpiod
-import os
-
-from gpiod.line import Edge
-
-def watch_line_falling(chip_path, line_offset):
-    with gpiod.request_lines(
-        chip_path,
-        consumer="watch-line-falling",
-        config={line_offset: gpiod.LineSettings(edge_detection=Edge.FALLING)},
-    ) as request:
-        while True:
-            # Blocks until at least one event is available
-            for event in request.read_edge_events():
-                print(
-                    "line: {}  type: Rising   event #{}".format(
-                        event.line_offset, event.line_seqno
-                    )
-                )
-                os.system("shutdown -h now")
-
-if __name__ == "__main__":
-    watch_line_falling("/dev/gpiochip0", 4)
diff --git a/power-button.py b/power-button.py
new file mode 100755 (executable)
index 0000000..584e0ac
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/python3
+# -*- coding: utf-8 -*-
+#
+# Power button watcher to initiate system shutdown
+# Copyright (C) 2025 Bdale Garbee <bdale@gag.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+#
+
+import gpiod
+import os
+
+from gpiod.line import Edge
+
+def watch_line_falling(chip_path, line_offset):
+    with gpiod.request_lines(
+        chip_path,
+        consumer="watch-line-falling",
+        config={line_offset: gpiod.LineSettings(edge_detection=Edge.FALLING)},
+    ) as request:
+        while True:
+            # Blocks until at least one event is available
+            for event in request.read_edge_events():
+                print(
+                    "line: {}  type: Rising   event #{}".format(
+                        event.line_offset, event.line_seqno
+                    )
+                )
+                os.system("shutdown -h now")
+
+if __name__ == "__main__":
+    watch_line_falling("/dev/gpiochip0", 4)