IS-Matrix-Forge 1.0.0.dev1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. is_matrix_forge-1.0.0.dev1/LICENSE.md +19 -0
  2. is_matrix_forge-1.0.0.dev1/PKG-INFO +190 -0
  3. is_matrix_forge-1.0.0.dev1/README.md +164 -0
  4. is_matrix_forge-1.0.0.dev1/is_matrix_forge/__init__.py +8 -0
  5. is_matrix_forge-1.0.0.dev1/is_matrix_forge/assets/__init__.py +8 -0
  6. is_matrix_forge-1.0.0.dev1/is_matrix_forge/assets/audio/__init__.py +36 -0
  7. is_matrix_forge-1.0.0.dev1/is_matrix_forge/assets/audio/files/__init__.py +53 -0
  8. is_matrix_forge-1.0.0.dev1/is_matrix_forge/assets/audio/files/plugged.wav +0 -0
  9. is_matrix_forge-1.0.0.dev1/is_matrix_forge/assets/audio/files/unplugged.wav +0 -0
  10. is_matrix_forge-1.0.0.dev1/is_matrix_forge/assets/char_map.json +2150 -0
  11. is_matrix_forge-1.0.0.dev1/is_matrix_forge/assets/font_map.py +119 -0
  12. is_matrix_forge-1.0.0.dev1/is_matrix_forge/common/__init__.py +0 -0
  13. is_matrix_forge-1.0.0.dev1/is_matrix_forge/common/decorators/__init__.py +152 -0
  14. is_matrix_forge-1.0.0.dev1/is_matrix_forge/common/dirs.py +20 -0
  15. is_matrix_forge-1.0.0.dev1/is_matrix_forge/common/helpers/__init__.py +132 -0
  16. is_matrix_forge-1.0.0.dev1/is_matrix_forge/common/helpers/github_api.py +67 -0
  17. is_matrix_forge-1.0.0.dev1/is_matrix_forge/designer_gui/__init__.py +8 -0
  18. is_matrix_forge-1.0.0.dev1/is_matrix_forge/designer_gui/main_window/__init__.py +252 -0
  19. is_matrix_forge-1.0.0.dev1/is_matrix_forge/designer_gui/main_window/layout.py +117 -0
  20. is_matrix_forge-1.0.0.dev1/is_matrix_forge/dev_tools/__init__.py +8 -0
  21. is_matrix_forge-1.0.0.dev1/is_matrix_forge/dev_tools/debug.py +82 -0
  22. is_matrix_forge-1.0.0.dev1/is_matrix_forge/dev_tools/presets.py +47 -0
  23. is_matrix_forge-1.0.0.dev1/is_matrix_forge/inputmodule/__init__.py +164 -0
  24. is_matrix_forge-1.0.0.dev1/is_matrix_forge/inputmodule/b1display.py +160 -0
  25. is_matrix_forge-1.0.0.dev1/is_matrix_forge/inputmodule/c1minimal.py +35 -0
  26. is_matrix_forge-1.0.0.dev1/is_matrix_forge/inputmodule/font.py +2166 -0
  27. is_matrix_forge-1.0.0.dev1/is_matrix_forge/inputmodule/helpers/__init__.py +16 -0
  28. is_matrix_forge-1.0.0.dev1/is_matrix_forge/inputmodule/ledmatrix.py +516 -0
  29. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/Scripts/__init__.py +4 -0
  30. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/Scripts/battery_monitor.py +152 -0
  31. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/Scripts/install_presets/__init__.py +2 -0
  32. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/Scripts/install_presets/arguments.py +84 -0
  33. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/Scripts/install_presets/main.py +192 -0
  34. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/__init__.py +7 -0
  35. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/commands/__init__.py +84 -0
  36. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/commands/map.py +46 -0
  37. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/constants.py +82 -0
  38. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/controller/__init__.py +26 -0
  39. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/controller/controller.py +635 -0
  40. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/controller/helpers/__init__.py +7 -0
  41. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/controller/helpers/threading.py +41 -0
  42. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/controller/multiton.py +32 -0
  43. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/controller/threaded.py +72 -0
  44. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/__init__.py +13 -0
  45. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/__init__.py +29 -0
  46. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/animation.py +593 -0
  47. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/effects/__init__.py +17 -0
  48. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/errors.py +23 -0
  49. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/font/__init__.py +17 -0
  50. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/font/font.py +4 -0
  51. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/font/map_builder.py +123 -0
  52. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/frame/__init__.py +47 -0
  53. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/frame/base.py +245 -0
  54. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/frame/helpers.py +67 -0
  55. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/keep_awake.py +1 -0
  56. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/plugged.py +0 -0
  57. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/animations/text_scroller.py +104 -0
  58. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/effects/__init__.py +17 -0
  59. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/effects/breather.py +206 -0
  60. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/effects/fade.py +0 -0
  61. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/effects/scroller/__init__.py +92 -0
  62. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/effects/scroller/base.py +76 -0
  63. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/effects/scroller/helpers.py +62 -0
  64. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/grid/__init__.py +9 -0
  65. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/grid/grid.py +208 -0
  66. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/grid/helpers.py +130 -0
  67. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/grid/presets/__init__.py +64 -0
  68. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/grid/presets/manifest.py +172 -0
  69. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/helpers/__init__.py +110 -0
  70. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/helpers/columns.py +33 -0
  71. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/media.py +199 -0
  72. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/patterns/__init__.py +59 -0
  73. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/patterns/built_in/__init__.py +91 -0
  74. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/patterns/built_in/commands.py +3 -0
  75. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/patterns/built_in/constants.py +29 -0
  76. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/patterns/built_in/stencils.py +70 -0
  77. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/patterns/utils.py +2 -0
  78. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/text/__init__.py +66 -0
  79. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/display/text/scroller.py +136 -0
  80. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/errors/__init__.py +4 -0
  81. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/errors/base.py +14 -0
  82. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/errors/grid.py +37 -0
  83. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/errors/matrix.py +68 -0
  84. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/errors/misc.py +36 -0
  85. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/fonts.py +20 -0
  86. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/hardware.py +172 -0
  87. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/helpers/__init__.py +165 -0
  88. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/helpers/core/__init__.py +17 -0
  89. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/helpers/core/lazy_mod_load.py +84 -0
  90. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/helpers/device.py +118 -0
  91. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/helpers/status_handler.py +14 -0
  92. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/helpers/stream/__init__.py +70 -0
  93. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/helpers/stream/errors.py +17 -0
  94. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/led_matrix.py +25 -0
  95. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/status.py +8 -0
  96. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/tools/__init__.py +8 -0
  97. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/tools/identify.py +27 -0
  98. is_matrix_forge-1.0.0.dev1/is_matrix_forge/led_matrix/utils/__init__.py +41 -0
  99. is_matrix_forge-1.0.0.dev1/is_matrix_forge/log_engine.py +25 -0
  100. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/__init__.py +68 -0
  101. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/errors.py +35 -0
  102. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/events.py +78 -0
  103. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/__init__.py +0 -0
  104. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/errors.py +35 -0
  105. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/event/__init__.py +8 -0
  106. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/event/collection.py +153 -0
  107. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/event/errors.py +58 -0
  108. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/event/event.py +226 -0
  109. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/layout/__init__.py +8 -0
  110. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/layout/base.py +147 -0
  111. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/metaclasses/__init__.py +20 -0
  112. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/windows/__init__.py +0 -0
  113. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/windows/base.py +325 -0
  114. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/windows/main/__init__.py +77 -0
  115. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/gui/windows/main/layout.py +21 -0
  116. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/helpers.py +55 -0
  117. is_matrix_forge-1.0.0.dev1/is_matrix_forge/monitor/monitor.py +431 -0
  118. is_matrix_forge-1.0.0.dev1/is_matrix_forge/notify/__init__.py +0 -0
  119. is_matrix_forge-1.0.0.dev1/is_matrix_forge/notify/sounds/__init__.py +6 -0
  120. is_matrix_forge-1.0.0.dev1/is_matrix_forge/notify/sounds/base.py +106 -0
  121. is_matrix_forge-1.0.0.dev1/is_matrix_forge/progress.py +99 -0
  122. is_matrix_forge-1.0.0.dev1/presets/blank.json +1 -0
  123. is_matrix_forge-1.0.0.dev1/presets/manifest.json +47 -0
  124. is_matrix_forge-1.0.0.dev1/presets/shock_face.json +1 -0
  125. is_matrix_forge-1.0.0.dev1/presets/test1.json +1 -0
  126. is_matrix_forge-1.0.0.dev1/presets/test2.json +1 -0
  127. is_matrix_forge-1.0.0.dev1/presets/test3.json +1 -0
  128. is_matrix_forge-1.0.0.dev1/presets/test4.json +1 -0
  129. is_matrix_forge-1.0.0.dev1/presets/test5.json +1 -0
  130. is_matrix_forge-1.0.0.dev1/presets/test6.json +1 -0
  131. is_matrix_forge-1.0.0.dev1/presets/test7.json +1 -0
  132. is_matrix_forge-1.0.0.dev1/presets/x_animation II.json +1 -0
  133. is_matrix_forge-1.0.0.dev1/presets/x_animation.json +1 -0
  134. is_matrix_forge-1.0.0.dev1/pyproject.toml +67 -0
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2025 Inspyre-Softworks
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software (led-matrix-battery) and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,190 @@
1
+ Metadata-Version: 2.3
2
+ Name: IS-Matrix-Forge
3
+ Version: 1.0.0.dev1
4
+ Summary:
5
+ License: MIT
6
+ Keywords: led,matrix,framework,hardware
7
+ Author: Taylor B.
8
+ Author-email: t.blackstone@inspyre.tech
9
+ Requires-Python: >=3.12,<4.0
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Provides-Extra: clipboard-support
15
+ Requires-Dist: chime (>=0.7.0,<0.8.0)
16
+ Requires-Dist: clipboard (>=0.0.4,<0.0.5) ; extra == "clipboard-support"
17
+ Requires-Dist: easy-exit-calls (>=1.0.0.dev1,<2.0.0)
18
+ Requires-Dist: inspy-logger (>=3.2.3,<4.0.0)
19
+ Requires-Dist: inspyre-toolbox (>=1.6.0.dev23)
20
+ Requires-Dist: opencv-python (>=4.11.0.86,<5.0.0.0)
21
+ Requires-Dist: pillow (>=11.2.1,<12.0.0)
22
+ Requires-Dist: pyserial (>=3.5,<4.0)
23
+ Requires-Dist: pysimplegui-4-foss (>=4.60.4.1,<5.0.0.0)
24
+ Requires-Dist: tk (>=0.1.0,<0.2.0)
25
+ Description-Content-Type: text/markdown
26
+
27
+ # LED Matrix Battery Monitor
28
+
29
+ A Python application that displays your computer's battery status on an LED matrix display. The application monitors battery level and power state, providing visual feedback on an LED matrix and audio notifications when power is plugged or unplugged.
30
+
31
+ ## Project Description and Purpose
32
+
33
+ The LED Matrix Battery Monitor is designed to provide a visual representation of your computer's battery status on an external LED matrix display. It serves as a convenient way to monitor battery levels without having to check your computer's status bar, especially useful for setups where the status bar might not be visible or when you want a more noticeable indicator.
34
+
35
+ Key features:
36
+ - Real-time battery level display on an LED matrix
37
+ - Visual animations when power is plugged in
38
+ - Audio notifications when power state changes (plugged/unplugged)
39
+ - Configurable checking intervals
40
+ - Support for multiple LED matrices
41
+
42
+ ## Hardware Requirements
43
+
44
+ - LED Matrix display with dimensions 9x34 (compatible with the project's specifications)
45
+ - Serial connection to the computer (USB)
46
+ - The LED matrix should have the following hardware identifiers:
47
+ - VID: 0x32AC
48
+ - PID: 0x20
49
+ - Serial Number Prefix: FRAK
50
+
51
+ ## Software Dependencies
52
+
53
+ This project requires Python 3.12 or newer and the following dependencies:
54
+
55
+ - chime (>=0.7.0,<0.8.0) - For audio notifications
56
+ - pyserial (>=3.5,<4.0) - For serial communication with the LED matrix
57
+ - inspy-logger (>=3.2.3,<4.0.0) - For logging
58
+ - inspyre-toolbox (>=1.6.0) - Utility functions
59
+ - pillow (>=11.2.1,<12.0.0) - Image processing
60
+ - opencv-python (>=4.11.0.86,<5.0.0.0) - Image processing
61
+ - pysimplegui-4-foss (>=4.60.4.1,<5.0.0.0) - GUI components
62
+ - tk (>=0.1.0,<0.2.0) - GUI toolkit
63
+ - easy-exit-calls (>=1.0.0.dev1,<2.0.0) - Exit handling
64
+ - psutil - For battery status monitoring
65
+
66
+ ## Installation Instructions
67
+
68
+ ### Using Poetry (Recommended)
69
+
70
+ 1. Clone the repository:
71
+ ```
72
+ git clone https://github.com/Inspyre-Softworks/led-matrix-battery.git
73
+ cd led-matrix-battery
74
+ ```
75
+
76
+ 2. Install dependencies using Poetry:
77
+ ```
78
+ poetry install
79
+ ```
80
+
81
+ 3. Activate the virtual environment:
82
+ ```
83
+ poetry shell
84
+ ```
85
+
86
+ ### Using pip
87
+
88
+ 1. Clone the repository:
89
+ ```
90
+ git clone https://github.com/Inspyre-Softworks/led-matrix-battery.git
91
+ cd led-matrix-battery
92
+ ```
93
+
94
+ 2. Install the package:
95
+ ```
96
+ pip install .
97
+ ```
98
+
99
+ ## Usage Examples
100
+
101
+ ### Basic Usage
102
+
103
+ To start monitoring your battery with default settings:
104
+
105
+ ```python
106
+ from is_matrix_forge.monitor import run_power_monitor
107
+ from is_matrix_forge.led_matrix.helpers.device import DEVICES
108
+
109
+ # Get the first available LED matrix device
110
+ device = DEVICES[0]
111
+
112
+ # Start monitoring with default settings
113
+ run_power_monitor(device)
114
+ ```
115
+
116
+ ### Custom Configuration
117
+
118
+ To customize the monitoring behavior:
119
+
120
+ ```python
121
+ from is_matrix_forge.monitor import run_power_monitor
122
+ from is_matrix_forge.led_matrix.helpers.device import DEVICES
123
+ from pathlib import Path
124
+
125
+ # Get the first available LED matrix device
126
+ device = DEVICES[0]
127
+
128
+ # Custom sound files
129
+ plugged_sound = Path("path/to/custom_plugged_sound.wav")
130
+ unplugged_sound = Path("path/to/custom_unplugged_sound.wav")
131
+
132
+ # Start monitoring with custom settings
133
+ run_power_monitor(
134
+ device,
135
+ battery_check_interval=10, # Check every 10 seconds
136
+ plugged_alert=plugged_sound,
137
+ unplugged_alert=unplugged_sound
138
+ )
139
+ ```
140
+
141
+ ### Running in a Thread
142
+
143
+ To run the monitor in a background thread:
144
+
145
+ ```python
146
+ from is_matrix_forge.monitor import run_power_monitor_threaded
147
+ from is_matrix_forge.led_matrix.helpers.device import DEVICES
148
+
149
+ # Get the first available LED matrix device
150
+ device = DEVICES[0]
151
+
152
+ # Start monitoring in a background thread
153
+ monitor = run_power_monitor_threaded(device)
154
+ # ``monitor`` is a :class:`threading.Thread` instance
155
+ ```
156
+
157
+ ## Troubleshooting
158
+
159
+ ### LED Matrix Not Detected
160
+
161
+ 1. Check that the LED matrix is properly connected to your computer.
162
+ 2. Verify that the LED matrix has the correct hardware identifiers (VID, PID, SN_PREFIX).
163
+ 3. Make sure you have the necessary permissions to access the serial port.
164
+ 4. Try running the application with administrator/root privileges.
165
+
166
+ ### Audio Notifications Not Working
167
+
168
+ 1. Ensure your system's audio is working correctly.
169
+ 2. Check that the WAV files for notifications exist in the expected locations.
170
+ 3. Verify that the chime library is properly installed.
171
+
172
+ ### Battery Status Not Updating
173
+
174
+ 1. Make sure psutil is properly installed.
175
+ 2. Check that your system supports battery status monitoring through psutil.
176
+ 3. Try increasing the battery_check_interval to reduce CPU usage.
177
+
178
+ ### Animation Issues
179
+
180
+ 1. Verify that the LED matrix is functioning correctly.
181
+ 2. Check that the matrix dimensions match the expected 9x34 size.
182
+ 3. Try clearing the matrix and restarting the application.
183
+
184
+ ## Contributing
185
+
186
+ Contributions to the LED Matrix Battery Monitor are welcome! Please feel free to submit a Pull Request.
187
+
188
+ ## License
189
+
190
+ This project is licensed under the MIT License - see the LICENSE.md file for details.
@@ -0,0 +1,164 @@
1
+ # LED Matrix Battery Monitor
2
+
3
+ A Python application that displays your computer's battery status on an LED matrix display. The application monitors battery level and power state, providing visual feedback on an LED matrix and audio notifications when power is plugged or unplugged.
4
+
5
+ ## Project Description and Purpose
6
+
7
+ The LED Matrix Battery Monitor is designed to provide a visual representation of your computer's battery status on an external LED matrix display. It serves as a convenient way to monitor battery levels without having to check your computer's status bar, especially useful for setups where the status bar might not be visible or when you want a more noticeable indicator.
8
+
9
+ Key features:
10
+ - Real-time battery level display on an LED matrix
11
+ - Visual animations when power is plugged in
12
+ - Audio notifications when power state changes (plugged/unplugged)
13
+ - Configurable checking intervals
14
+ - Support for multiple LED matrices
15
+
16
+ ## Hardware Requirements
17
+
18
+ - LED Matrix display with dimensions 9x34 (compatible with the project's specifications)
19
+ - Serial connection to the computer (USB)
20
+ - The LED matrix should have the following hardware identifiers:
21
+ - VID: 0x32AC
22
+ - PID: 0x20
23
+ - Serial Number Prefix: FRAK
24
+
25
+ ## Software Dependencies
26
+
27
+ This project requires Python 3.12 or newer and the following dependencies:
28
+
29
+ - chime (>=0.7.0,<0.8.0) - For audio notifications
30
+ - pyserial (>=3.5,<4.0) - For serial communication with the LED matrix
31
+ - inspy-logger (>=3.2.3,<4.0.0) - For logging
32
+ - inspyre-toolbox (>=1.6.0) - Utility functions
33
+ - pillow (>=11.2.1,<12.0.0) - Image processing
34
+ - opencv-python (>=4.11.0.86,<5.0.0.0) - Image processing
35
+ - pysimplegui-4-foss (>=4.60.4.1,<5.0.0.0) - GUI components
36
+ - tk (>=0.1.0,<0.2.0) - GUI toolkit
37
+ - easy-exit-calls (>=1.0.0.dev1,<2.0.0) - Exit handling
38
+ - psutil - For battery status monitoring
39
+
40
+ ## Installation Instructions
41
+
42
+ ### Using Poetry (Recommended)
43
+
44
+ 1. Clone the repository:
45
+ ```
46
+ git clone https://github.com/Inspyre-Softworks/led-matrix-battery.git
47
+ cd led-matrix-battery
48
+ ```
49
+
50
+ 2. Install dependencies using Poetry:
51
+ ```
52
+ poetry install
53
+ ```
54
+
55
+ 3. Activate the virtual environment:
56
+ ```
57
+ poetry shell
58
+ ```
59
+
60
+ ### Using pip
61
+
62
+ 1. Clone the repository:
63
+ ```
64
+ git clone https://github.com/Inspyre-Softworks/led-matrix-battery.git
65
+ cd led-matrix-battery
66
+ ```
67
+
68
+ 2. Install the package:
69
+ ```
70
+ pip install .
71
+ ```
72
+
73
+ ## Usage Examples
74
+
75
+ ### Basic Usage
76
+
77
+ To start monitoring your battery with default settings:
78
+
79
+ ```python
80
+ from is_matrix_forge.monitor import run_power_monitor
81
+ from is_matrix_forge.led_matrix.helpers.device import DEVICES
82
+
83
+ # Get the first available LED matrix device
84
+ device = DEVICES[0]
85
+
86
+ # Start monitoring with default settings
87
+ run_power_monitor(device)
88
+ ```
89
+
90
+ ### Custom Configuration
91
+
92
+ To customize the monitoring behavior:
93
+
94
+ ```python
95
+ from is_matrix_forge.monitor import run_power_monitor
96
+ from is_matrix_forge.led_matrix.helpers.device import DEVICES
97
+ from pathlib import Path
98
+
99
+ # Get the first available LED matrix device
100
+ device = DEVICES[0]
101
+
102
+ # Custom sound files
103
+ plugged_sound = Path("path/to/custom_plugged_sound.wav")
104
+ unplugged_sound = Path("path/to/custom_unplugged_sound.wav")
105
+
106
+ # Start monitoring with custom settings
107
+ run_power_monitor(
108
+ device,
109
+ battery_check_interval=10, # Check every 10 seconds
110
+ plugged_alert=plugged_sound,
111
+ unplugged_alert=unplugged_sound
112
+ )
113
+ ```
114
+
115
+ ### Running in a Thread
116
+
117
+ To run the monitor in a background thread:
118
+
119
+ ```python
120
+ from is_matrix_forge.monitor import run_power_monitor_threaded
121
+ from is_matrix_forge.led_matrix.helpers.device import DEVICES
122
+
123
+ # Get the first available LED matrix device
124
+ device = DEVICES[0]
125
+
126
+ # Start monitoring in a background thread
127
+ monitor = run_power_monitor_threaded(device)
128
+ # ``monitor`` is a :class:`threading.Thread` instance
129
+ ```
130
+
131
+ ## Troubleshooting
132
+
133
+ ### LED Matrix Not Detected
134
+
135
+ 1. Check that the LED matrix is properly connected to your computer.
136
+ 2. Verify that the LED matrix has the correct hardware identifiers (VID, PID, SN_PREFIX).
137
+ 3. Make sure you have the necessary permissions to access the serial port.
138
+ 4. Try running the application with administrator/root privileges.
139
+
140
+ ### Audio Notifications Not Working
141
+
142
+ 1. Ensure your system's audio is working correctly.
143
+ 2. Check that the WAV files for notifications exist in the expected locations.
144
+ 3. Verify that the chime library is properly installed.
145
+
146
+ ### Battery Status Not Updating
147
+
148
+ 1. Make sure psutil is properly installed.
149
+ 2. Check that your system supports battery status monitoring through psutil.
150
+ 3. Try increasing the battery_check_interval to reduce CPU usage.
151
+
152
+ ### Animation Issues
153
+
154
+ 1. Verify that the LED matrix is functioning correctly.
155
+ 2. Check that the matrix dimensions match the expected 9x34 size.
156
+ 3. Try clearing the matrix and restarting the application.
157
+
158
+ ## Contributing
159
+
160
+ Contributions to the LED Matrix Battery Monitor are welcome! Please feel free to submit a Pull Request.
161
+
162
+ ## License
163
+
164
+ This project is licensed under the MIT License - see the LICENSE.md file for details.
@@ -0,0 +1,8 @@
1
+ """
2
+ Author: Taylor B. tayjaybabee@gmail.com
3
+ Date: 2025-04-15 09:15:25
4
+ LastEditors: Taylor B. tayjaybabee@gmail.com
5
+ LastEditTime: 2025-04-15 09:24:40
6
+ FilePath: is_matrix_forge/__init__.py
7
+ Description: 这是默认设置,可以在设置》工具》File Description中进行配置
8
+ """
@@ -0,0 +1,8 @@
1
+ """
2
+ Author: Taylor B. tayjaybabee@gmail.com
3
+ Date: 2025-04-15 09:15:37
4
+ LastEditors: Taylor B. tayjaybabee@gmail.com
5
+ LastEditTime: 2025-04-15 09:24:40
6
+ FilePath: is_matrix_forge/assets/__init__.py
7
+ Description: 这是默认设置,可以在设置》工具》File Description中进行配置
8
+ """
@@ -0,0 +1,36 @@
1
+ from chime import play_wav
2
+ from .files import AUDIO_MAP as PLUG_ALERT_MAP
3
+ from is_matrix_forge.log_engine import ROOT_LOGGER as PARENT_LOGGER
4
+
5
+
6
+ MOD_LOGGER = PARENT_LOGGER.get_child('assets.audio')
7
+
8
+
9
+ def alert(alert_type: str):
10
+ """
11
+ Plays an alert sound.
12
+
13
+ Parameters:
14
+ alert_type (str):
15
+ The type of alert sound to play.
16
+ """
17
+ log = MOD_LOGGER.get_child('alert')
18
+
19
+ if not isinstance(alert_type, str):
20
+ log.error(f'"alert_type" must be a string, not {type(alert_type)}')
21
+ raise TypeError(f'alert_type must be a string, not {type(alert_type)}')
22
+
23
+ alert_type = alert_type.lower().strip()
24
+ log.debug(f'Checking if alert_type is valid: {alert_type} ({type(alert_type)})')
25
+ if alert_type not in PLUG_ALERT_MAP:
26
+ log.error(f'Invalid alert_type: {alert_type}')
27
+ raise ValueError(f'alert_type must be one of {", ".join(PLUG_ALERT_MAP.keys())}')
28
+
29
+ log.debug(f'Playing alert sound: {alert_type}')
30
+ play_wav(PLUG_ALERT_MAP[alert_type])
31
+
32
+
33
+ __all__ = [
34
+ 'alert'
35
+ ]
36
+
@@ -0,0 +1,53 @@
1
+ from pathlib import Path
2
+ from is_matrix_forge.log_engine import ROOT_LOGGER as PARENT_LOGGER
3
+
4
+
5
+ MOD_LOGGER = PARENT_LOGGER.get_child('assets.audio.files')
6
+
7
+
8
+ CUR_DIR = Path(__file__).parent.expanduser().resolve().absolute()
9
+ MOD_LOGGER.debug(f'Audio files directory: {CUR_DIR}')
10
+
11
+ AUDIO_MAP = {
12
+ 'plugged': CUR_DIR / 'plugged.wav',
13
+ 'unplugged': CUR_DIR / 'unplugged.wav'
14
+ }
15
+
16
+
17
+ def integrity_check():
18
+ """
19
+ Checks the integrity of the audio files.
20
+
21
+ Raises:
22
+ FileNotFoundError:
23
+ If any of the audio files are not found.
24
+
25
+ Returns:
26
+ None
27
+ """
28
+ log = MOD_LOGGER.get_child('integrity_check')
29
+ log.debug('Checking audio files...')
30
+ for file in AUDIO_MAP.values():
31
+ log.debug(f'Checking file: {file}')
32
+ if not file.exists():
33
+ log.error(f'File not found: {file}')
34
+ raise FileNotFoundError(f'Audio file not found: {file}')
35
+
36
+ if not file.is_file():
37
+ log.error(f'File is not a file: {file}')
38
+ raise FileNotFoundError(f'Audio file not found: {file}')
39
+
40
+ log.debug('Audio files are valid.')
41
+ return True
42
+
43
+
44
+ MOD_LOGGER.debug('Performing integrity check...')
45
+
46
+ if not integrity_check():
47
+ MOD_LOGGER.error('Audio files are invalid.')
48
+ raise FileNotFoundError('Audio files are invalid.')
49
+
50
+
51
+ __all__ = [
52
+ 'AUDIO_MAP',
53
+ ]