idotmatrix-api-client 0.2.0__py3-none-any.whl

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 (63) hide show
  1. idotmatrix/__init__.py +15 -0
  2. idotmatrix/apps/__init__.py +0 -0
  3. idotmatrix/apps/digital_picture_frame.py +541 -0
  4. idotmatrix/client.py +284 -0
  5. idotmatrix/connection_manager.py +702 -0
  6. idotmatrix/const.py +30 -0
  7. idotmatrix/fonts/16-ErbosDraco1StOpenNbpRegular-l5wX.ttf +0 -0
  8. idotmatrix/fonts/16-MinecraftStandard.otf +0 -0
  9. idotmatrix/fonts/16-MinecraftStandardBoldOblique.otf +0 -0
  10. idotmatrix/fonts/16-PixelOperator8-Bold.ttf +0 -0
  11. idotmatrix/fonts/16-PixelOperator8.ttf +0 -0
  12. idotmatrix/fonts/16-PixelifySans-Regular.ttf +0 -0
  13. idotmatrix/fonts/16-PressStart2P-Regular.ttf +0 -0
  14. idotmatrix/fonts/16-dogica.ttf +0 -0
  15. idotmatrix/fonts/16-dogicabold.ttf +0 -0
  16. idotmatrix/fonts/16-dogicapixel.ttf +0 -0
  17. idotmatrix/fonts/16-dogicapixelbold.ttf +0 -0
  18. idotmatrix/fonts/16_32-HomeVideo-BLG6G.ttf +0 -0
  19. idotmatrix/fonts/16_32-HomeVideoBold-R90Dv.ttf +0 -0
  20. idotmatrix/fonts/16_32-MayfairNbpBold-gAA4.ttf +0 -0
  21. idotmatrix/fonts/32-Jersey10-Regular.ttf +0 -0
  22. idotmatrix/fonts/CC-BY-SA-4.0-License.txt +428 -0
  23. idotmatrix/fonts/ErbosDraco-License.txt +3 -0
  24. idotmatrix/fonts/HomeVideo-License.txt +2 -0
  25. idotmatrix/fonts/Jersey10-Regular-License.txt +93 -0
  26. idotmatrix/fonts/MayfairNbpBold-License.txt +3 -0
  27. idotmatrix/fonts/MinecraftStandard-License.txt +5 -0
  28. idotmatrix/fonts/PixelOperator-License.txt +121 -0
  29. idotmatrix/fonts/PixelifySans-License.txt +93 -0
  30. idotmatrix/fonts/PressStart2P-Regular-License.txt +93 -0
  31. idotmatrix/fonts/Rain-DRM3-License.txt +44 -0
  32. idotmatrix/fonts/Rain-DRM3.otf +0 -0
  33. idotmatrix/fonts/dogica_license.txt +94 -0
  34. idotmatrix/modules/__init__.py +64 -0
  35. idotmatrix/modules/chronograph.py +50 -0
  36. idotmatrix/modules/clock.py +101 -0
  37. idotmatrix/modules/common.py +176 -0
  38. idotmatrix/modules/countdown.py +70 -0
  39. idotmatrix/modules/eco.py +63 -0
  40. idotmatrix/modules/effect.py +79 -0
  41. idotmatrix/modules/fullscreen_color.py +55 -0
  42. idotmatrix/modules/gif.py +403 -0
  43. idotmatrix/modules/graffiti.py +71 -0
  44. idotmatrix/modules/image.py +383 -0
  45. idotmatrix/modules/music_sync.py +67 -0
  46. idotmatrix/modules/scoreboard.py +38 -0
  47. idotmatrix/modules/system.py +65 -0
  48. idotmatrix/modules/text.py +232 -0
  49. idotmatrix/protocol.py +52 -0
  50. idotmatrix/screensize.py +8 -0
  51. idotmatrix/transport.py +137 -0
  52. idotmatrix/util/__init__.py +0 -0
  53. idotmatrix/util/color_utils.py +64 -0
  54. idotmatrix/util/command_ack.py +23 -0
  55. idotmatrix/util/device_info.py +38 -0
  56. idotmatrix/util/device_material.py +16 -0
  57. idotmatrix/util/file_watch.py +57 -0
  58. idotmatrix/util/image_utils.py +139 -0
  59. idotmatrix/util/upload_ack.py +42 -0
  60. idotmatrix_api_client-0.2.0.dist-info/METADATA +375 -0
  61. idotmatrix_api_client-0.2.0.dist-info/RECORD +63 -0
  62. idotmatrix_api_client-0.2.0.dist-info/WHEEL +4 -0
  63. idotmatrix_api_client-0.2.0.dist-info/licenses/LICENSE +674 -0
@@ -0,0 +1,139 @@
1
+ from enum import Enum
2
+
3
+ from PIL import Image as PILImage
4
+
5
+
6
+ def palettize(
7
+ image: PILImage.Image,
8
+ dither: PILImage.Dither = PILImage.Dither.NONE,
9
+ colors: int = 256
10
+ ) -> PILImage.Image:
11
+ """
12
+ Convert an image to use a specific palette.
13
+
14
+ :param image: The input image to be palettized.
15
+ :param dither: The dithering method to use (default is PILImage.Dither.NONE).
16
+ Other options include PILImage.Dither.FLOYDSTEINBERG, PILImage.Dither.ORDERED, etc.
17
+ :param colors: The number of colors in the palette (default is 256).
18
+ :return: The palettized image.
19
+ """
20
+ if not isinstance(image, PILImage.Image):
21
+ raise TypeError("Input must be a PIL Image.")
22
+
23
+ return image.convert(
24
+ mode="P",
25
+ dither=dither,
26
+ palette=PILImage.Palette.ADAPTIVE,
27
+ colors=colors
28
+ )
29
+
30
+
31
+ def pad_palette(image: PILImage.Image, size: int = 256) -> PILImage.Image:
32
+ """
33
+ Makes sure an image is palettized and its palette has exactly `size` entries.
34
+
35
+ PIL writes palettes that are only as large as the number of colors an image uses, so the
36
+ color tables of the frames in an animation differ in size. The iDotMatrix device garbles
37
+ or drops frames of GIFs like that.
38
+
39
+ :param image: The input image, converted with `palettize` if it is not palettized yet.
40
+ :param size: The number of palette entries (default is 256).
41
+ :return: A palettized image with a palette of `size` entries.
42
+ """
43
+ if image.mode != "P":
44
+ image = palettize(image.convert("RGB"), colors=size)
45
+ else:
46
+ image = image.copy()
47
+
48
+ palette = image.getpalette()[:size * 3]
49
+ palette += [0] * (size * 3 - len(palette))
50
+ image.putpalette(palette)
51
+ return image
52
+
53
+
54
+ class ResizeMode(Enum):
55
+ """
56
+ Enum for resize modes.
57
+ """
58
+ FIT = "fit" # Resize to fit within the canvas while maintaining aspect ratio
59
+ FILL = "fill" # Resize to fill the canvas, may crop the image, but maintains aspect ratio
60
+ STRETCH = "stretch" # Stretch the image to fit the canvas, may distort the image
61
+
62
+
63
+ def resize_image(
64
+ image: PILImage.Image,
65
+ canvas_size: int,
66
+ resize_mode: ResizeMode,
67
+ resample_mode: PILImage.Resampling,
68
+ background_color: tuple[int, int, int] = (0, 0, 0),
69
+ mode: str = "RGB",
70
+ ) -> PILImage.Image:
71
+ """
72
+ Resize an image to a specific size.
73
+
74
+ :param image: The input image to be resized.
75
+ :param canvas_size: The (square) size of the canvas to fit the image into.
76
+ :param resize_mode: The mode to use for resizing the image (ResizeMode.FIT, ResizeMode.FILL, ResizeMode.STRETCH).
77
+ :param resample_mode: The resampling mode to use for resizing (e.g., PILImage.Resampling.LANCZOS).
78
+ :param background_color: The color to fill the background with if the image does not fill the whole canvas.
79
+ :param mode: The mode to use for the new image (default is "RGB").
80
+ :return: The resized image.
81
+ """
82
+ if resize_mode == ResizeMode.FIT:
83
+ # if the dimensions of the frame are not equal to the pixel size, resize it while maintaining the aspect ratio
84
+ # and adding a black background if necessary.
85
+ ratio = min(canvas_size / image.width, canvas_size / image.height)
86
+ new_size = (int(image.width * ratio), int(image.height * ratio))
87
+ image = image.resize(
88
+ size=new_size,
89
+ resample=resample_mode,
90
+ )
91
+ elif resize_mode == ResizeMode.FILL:
92
+ # if the dimensions of the frame are not equal to the pixel size, resize it to fill the canvas
93
+ # this might crop the image, but maintains aspect ratio
94
+ ratio = max(canvas_size / image.width, canvas_size / image.height)
95
+ new_size = (int(image.width * ratio), int(image.height * ratio))
96
+ image = image.resize(
97
+ size=new_size,
98
+ resample=resample_mode,
99
+ )
100
+ # crop anything that is outside the canvas size
101
+ box = (
102
+ (image.width - canvas_size) // 2,
103
+ (image.height - canvas_size) // 2,
104
+ (image.width + canvas_size) // 2,
105
+ (image.height + canvas_size) // 2,
106
+ )
107
+ image = image.crop(box)
108
+ elif resize_mode == ResizeMode.STRETCH:
109
+ # if the dimensions of the frame are not equal to the pixel size, stretch it to fit the canvas
110
+ # and add a black background if necessary.
111
+ image = image.resize(
112
+ size=(canvas_size, canvas_size),
113
+ resample=resample_mode,
114
+ )
115
+
116
+ # convert transparent pixels to the background color
117
+ new_image = PILImage.new(
118
+ mode="RGBA",
119
+ size=(canvas_size, canvas_size),
120
+ color=background_color
121
+ )
122
+ new_image.paste(
123
+ im=image,
124
+ box=((canvas_size - image.width) // 2, (canvas_size - image.height) // 2),
125
+ mask=image.convert("RGBA")
126
+ )
127
+ image = new_image
128
+
129
+ # ensure exact image dimensions
130
+ # ensure the image is always exactly canvas_size x canvas_size pixels and
131
+ # fill the background behind the image with background_color, if the image doesn't fill the whole canvas
132
+ new_img = PILImage.new(mode, (canvas_size, canvas_size), background_color)
133
+ new_img.paste(
134
+ im=image,
135
+ box=((canvas_size - image.width) // 2, (canvas_size - image.height) // 2)
136
+ )
137
+ image = new_img
138
+
139
+ return image
@@ -0,0 +1,42 @@
1
+ from enum import Enum
2
+ from typing import Optional
3
+
4
+ # The device acknowledges every 4096 byte chunk of an image or GIF upload with a notification
5
+ # of the form 05 00 <type> 00 <status>. The official app does not send the next chunk before it
6
+ # received that acknowledgement.
7
+ TYPE_DIY_IMAGE = 0
8
+ TYPE_GIF = 1
9
+ TYPE_IMAGE = 2
10
+
11
+
12
+ class UploadStatus(Enum):
13
+ NEXT = "next" # chunk received, send the next one
14
+ FINISHED = "finished" # the upload is complete (or the device already has the same data stored)
15
+ ERROR = "error" # the device rejected the data (f.e. not enough space)
16
+
17
+
18
+ def parse_upload_notification(data: bytes | bytearray) -> Optional[UploadStatus]:
19
+ """
20
+ Interprets a notification of the device during an upload.
21
+ Args:
22
+ data: The raw notification.
23
+ Returns:
24
+ The status the notification stands for, or None if it is not related to uploads.
25
+ """
26
+ if len(data) < 5 or data[0] != 5 or data[1] != 0 or data[3] != 0:
27
+ return None
28
+
29
+ upload_type, status = data[2], data[4]
30
+ if upload_type == TYPE_DIY_IMAGE:
31
+ if status == 2:
32
+ return UploadStatus.NEXT
33
+ if status in (0, 1):
34
+ return UploadStatus.FINISHED
35
+ elif upload_type in (TYPE_GIF, TYPE_IMAGE):
36
+ if status == 1:
37
+ return UploadStatus.NEXT
38
+ if status == 3:
39
+ return UploadStatus.FINISHED
40
+ if status in (0, 2):
41
+ return UploadStatus.ERROR
42
+ return None
@@ -0,0 +1,375 @@
1
+ Metadata-Version: 2.4
2
+ Name: idotmatrix-api-client
3
+ Version: 0.2.0
4
+ Summary: A library for controlling iDotMatrix displays.
5
+ License-Expression: GPL-3.0-or-later
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.12,<3.15
8
+ Classifier: Intended Audience :: Developers
9
+ Requires-Dist: bleak (>=0.22.3)
10
+ Requires-Dist: cryptography (>=46.0.7)
11
+ Requires-Dist: pillow (>=12.2.0)
12
+ Requires-Dist: watchdog (>=6.0.0)
13
+ Project-URL: Bug Tracker, https://github.com/markusressel/idotmatrix-api-client/issues
14
+ Project-URL: Documentation, https://github.com/markusressel/idotmatrix-api-client
15
+ Project-URL: Homepage, https://github.com/markusressel/idotmatrix-api-client
16
+ Project-URL: Repository, https://github.com/markusressel/idotmatrix-api-client
17
+ Description-Content-Type: text/markdown
18
+
19
+ > [!NOTE]
20
+ > This is a fork of the original
21
+ > project [derkalle4/python3-idotmatrix-library](https://github.com/derkalle4/python3-idotmatrix-library) which is no
22
+ > longer maintained due to the
23
+ > author's health condition. This fork aims to continue the development and maintenance of the library, ensuring it
24
+ > remains functional and up-to-date for users who rely on it for
25
+ > controlling iDotMatrix pixel displays.
26
+
27
+ > [!CAUTION]
28
+ > **Not compatible with the original project!**
29
+ > While the featureset should be identical (or better), the structure of the original project has been significantly
30
+ > altered to improve usability and maintainability. This means it is not possible to switch between the original and
31
+ > this fork without manually adjusting the code.
32
+ >
33
+ > In addition to that, the support for returning the raw bytearray data for specific commands **has been dropped**
34
+ > to simplify maintenance and usability of the library.
35
+
36
+ <br/>
37
+ <p align="center">
38
+ <a href="https://github.com/derkamarkusressel/python3-idotmatrix-library">
39
+ <img src="images/logo.png" alt="Logo" width="250" height="250">
40
+ </a>
41
+
42
+ <h3 align="center">Pixel Display Library</h3>
43
+
44
+ <p align="center">
45
+ Control all your 16x16 or 32x32 or 64x64 iDotMatrix Pixel Displays
46
+ <br/>
47
+ <br/>
48
+ <a href="https://github.com/markusressel/python3-idotmatrix-library/issues">Report Bug</a>
49
+ or
50
+ <a href="https://github.com/markusressel/python3-idotmatrix-library/issues">Request Feature</a>
51
+ </p>
52
+ </p>
53
+
54
+ ![Contributors](https://img.shields.io/github/contributors/markusressel/python3-idotmatrix-library?color=dark-green) ![License](https://img.shields.io/github/license/markusressel/python3-idotmatrix-library)
55
+
56
+ ## Table Of Contents
57
+
58
+ * [About the Project](#about-the-project)
59
+ * [Getting Started](#getting-started)
60
+ * [Prerequisites](#prerequisites)
61
+ * [Installation](#installation)
62
+ * [Usage](#usage)
63
+ * [Fonts](#fonts)
64
+ * [Roadmap](#roadmap)
65
+ * [Contributing](#contributing)
66
+ * [License](#license)
67
+ * [Authors](#authors)
68
+ * [Acknowledgements](#acknowledgements)
69
+
70
+ ## About The Project
71
+
72
+ This repository aims to reverse engineer
73
+ the [iDotMatrix](https://play.google.com/store/apps/details?id=com.tech.idotmatrix&pli=1) Android App for pixel screen
74
+ displays like [this one on Aliexpress](https://de.aliexpress.com/item/1005006105517779.html). The goal is to provide a
75
+ library which can be used to
76
+ connect and control these displays without the need for the official app.
77
+
78
+ ## Getting Started
79
+
80
+ ### Prerequisites
81
+
82
+ Please install the following for your distribution (Windows may work but it is untested):
83
+
84
+ * latest Python3
85
+ * Python3 Virtual Env
86
+
87
+ ### Installation
88
+
89
+ #### use latest github source code
90
+
91
+ 1. Clone the repo
92
+
93
+ ```sh
94
+ git clone https://github.com/markusressel/python3-idotmatrix-library.git
95
+ ```
96
+
97
+ 2. Install the latest version locally
98
+
99
+ ```sh
100
+ cd python3-idotmatrix-library/
101
+ python3 -m venv venv
102
+ source venv/bin/activate # on Windows use `venv\Scripts\activate`
103
+ pip install --upgrade pip poetry
104
+ poetry install
105
+ ```
106
+
107
+ ## Usage
108
+
109
+ ### Device API Client
110
+
111
+ ```python
112
+ import asyncio
113
+
114
+ from idotmatrix import IDotMatrixClient, ScreenSize
115
+
116
+
117
+ async def main():
118
+ # create a new IDotMatrixClient instance
119
+ client = IDotMatrixClient(
120
+ # (optional) the screen size of your device, ScreenSize.SIZE_64x64, SIZE_32x32 or SIZE_16x16.
121
+ # If it is left out, the client asks the device when connecting (so call `connect` before using images or GIFs).
122
+ screen_size=ScreenSize.SIZE_64x64,
123
+ # mac_address="00:11:22:33:44:55", # (optional) specify your device's Bluetooth address
124
+ )
125
+ # (optional) connect to first found iDotMatrix Pixel Display
126
+ # If the device is not connected when issuing commands, an automatic connection attempt will be made.
127
+ await client.connect()
128
+
129
+ # do something with the device by using one of the toplevel functions or modules e.g. chronograph, clock, countdown, etc.
130
+ await client.set_brightness(50) # set brightness to 50%
131
+
132
+ await client.text.show_text("Hello World!") # display text on the screen
133
+
134
+
135
+ if __name__ == "__main__":
136
+ try:
137
+ asyncio.run(main())
138
+ except KeyboardInterrupt:
139
+ quit()
140
+ ```
141
+
142
+ For more examples please check the [example.py](./example.py).
143
+
144
+ #### Images and GIFs
145
+
146
+ ```python
147
+ from idotmatrix.util.image_utils import ResizeMode
148
+
149
+ # show a photo or any other image, scaled to the screen
150
+ await client.image.show_image_file("photo.jpg", resize_mode=ResizeMode.FILL)
151
+
152
+ # show an animated GIF
153
+ await client.gif.upload_gif_file("animation.gif")
154
+ ```
155
+
156
+ Both can be mixed freely, no mode switching is needed in between. They work like the official app, which waits
157
+ for the device to acknowledge each chunk of data. An `UploadError` is raised if the device rejects an upload or does
158
+ not answer.
159
+
160
+ `client.image.upload_image_file` uses the DIY mode instead (see `client.image.set_mode`), which is meant for drawing
161
+ pixel by pixel and has to be left again before a GIF can be shown.
162
+
163
+ #### Home Assistant and other Bluetooth stacks
164
+
165
+ A Home Assistant integration that is built on this library is in development: [ha-idotmatrix](https://github.com/markusressel/ha-idotmatrix).
166
+
167
+ By default the library connects with `bleak` itself. If something else owns the Bluetooth stack, like the scanner and
168
+ the Bluetooth proxies of Home Assistant, hand over what it found or how to connect:
169
+
170
+ ```python
171
+ # a BLEDevice that a scanner found, instead of a MAC address
172
+ client = IDotMatrixClient(screen_size=ScreenSize.SIZE_64x64, ble_device=ble_device)
173
+
174
+ # or provide the whole connection, by implementing `idotmatrix.transport.Transport`
175
+ client = IDotMatrixClient(
176
+ screen_size=ScreenSize.SIZE_64x64,
177
+ mac_address="00:11:22:33:44:55",
178
+ transport_factory=lambda address_or_device, on_disconnected: MyTransport(address_or_device, on_disconnected),
179
+ )
180
+ ```
181
+
182
+ Turn off `install_signal_handlers` if your application handles SIGINT and SIGTERM itself, otherwise the client
183
+ replaces the handlers of the event loop to close the connection on exit. To connect with `bleak-retry-connector`
184
+ (Bluetooth proxies), create the transport yourself: `BleakTransport(address_or_device, on_disconnected, connector=...)`
185
+ where the connector is an async function that returns a connected `BleakClient`, like `establish_connection`.
186
+
187
+ `ConnectionManager.set_device(ble_device)` hands over a newer `BLEDevice` later. An established connection stays, the
188
+ new one is used for the next connection. A `Transport` has to write to the device, deliver its notifications and call
189
+ `on_disconnected` when the link is lost, see `idotmatrix/transport.py` and the `FakeTransport` in `tests/` for an example.
190
+
191
+ ### Digital Picture Frame
192
+
193
+ Besides the `IDotMatrixClient`, this repository also contains a `DigitalPictureFrame` class which can be used
194
+ to display images and GIFs in a slideshow fashion.
195
+ See [example_digital_picture_frame.py](./example_digital_picture_frame.py)
196
+ for more details on how to use it.
197
+
198
+ The `DigitalPictureFrame` can
199
+
200
+ * display a static list of images and/or GIFs
201
+ * watch one or more directories for images and GIFs
202
+ * automatically reconnect to the device in case of an error or connection loss
203
+
204
+ ## Fonts
205
+
206
+ `text.display_text()` (and `TextModule.show_text()`) rasterize each character directly to on/off
207
+ pixels (1-bit, no anti-aliasing) and send it to the device using one of two fixed per-character
208
+ cell sizes:
209
+
210
+ * a compact **8x16** cell, used automatically whenever every character of the string fits within
211
+ 8px wide / 16px tall
212
+ * the full **16x32** cell, used as a fallback for wider/taller glyphs (to avoid clipping)
213
+
214
+ Because there's no anti-aliasing step, regular vector fonts (the kind designed for print/screen
215
+ text with serifs, thin strokes, or fine curves) often render with broken strokes, gaps, or lopsided
216
+ shapes at these tiny sizes - especially once a font's fine details get thresholded straight to
217
+ black/white. This shows up as visual "artifacts": jagged edges, disconnected letterforms, or an
218
+ uneven look between different characters of the same font.
219
+
220
+ **Pixel/bitmap-style fonts** avoid this problem entirely, since they are designed on a fixed pixel
221
+ grid to begin with (no fine detail to lose) and render cleanly at any size that's a clean multiple
222
+ of their native grid.
223
+
224
+ ### `font_size` doesn't grow the per-character cell
225
+
226
+ The 8x16/16x32 cell picked above is **fixed in pixel width** (8px or 16px) regardless of the
227
+ `font_size` you pass in - `font_size` only changes how big the glyph is drawn *within* that fixed
228
+ cell, it never widens the cell itself. Each character's cell bitmap is then sent back-to-back with
229
+ no extra spacing added between characters.
230
+
231
+ This means a font that isn't specifically designed to stay narrow at the `font_size` you're using
232
+ will render a glyph that fills (or even overflows) the entire 8px/16px cell width, leaving no blank
233
+ margin to act as letter-spacing - so consecutive characters end up touching or overlapping. This is
234
+ why the same font can look perfectly fine at one `font_size` and become illegible at a larger one:
235
+ a font's glyph width generally scales with `font_size`, but the cell width doesn't.
236
+
237
+ The bundled default (`Rain-DRM3.otf`) works around this by being intentionally narrow relative to
238
+ its point size, so it still leaves a gap even at larger sizes. Most other fonts need a specific,
239
+ manually-verified `font_size` to look right - see the naming convention below.
240
+
241
+ ### Bundled fonts
242
+
243
+ The [`idotmatrix/fonts/`](idotmatrix/fonts/) directory is part of the installed package and ships a selection of pixel/bitmap fonts (with their respective
244
+ license files) that have been verified to render cleanly. Each filename (other than the default) is
245
+ prefixed with the `font_size` value(s) it has been manually tested and confirmed to render with
246
+ legible spacing between characters - always pass a matching `font_size`, since (per above) using a
247
+ larger one than the font was designed for will make characters touch/overlap:
248
+
249
+ | Font file(s) | Recommended `font_size` | Notes |
250
+ | --- | --- | --- |
251
+ | `16-PressStart2P-Regular.ttf` | 16 | Classic 8x8 arcade-style pixel font. Most reliable default at size 16. |
252
+ | `16-dogica.ttf`, `16-dogicabold.ttf`, `16-dogicapixel.ttf`, `16-dogicapixelbold.ttf` | 16 | Small pixel-grid font family, regular/bold/"pixel" variants. |
253
+ | `16-PixelOperator8.ttf`, `16-PixelOperator8-Bold.ttf` | 16 | 8px-grid pixel font family. |
254
+ | `16-MinecraftStandard.otf`, `16-MinecraftStandardBoldOblique.otf` | 16 | Blocky pixel-grid font, good legibility at small sizes. |
255
+ | `16-ErbosDraco1StOpenNbpRegular-l5wX.ttf` | 16 | Narrow pixel-style font (fits the compact 8x16 cell at size 16). |
256
+ | `16-PixelifySans-Regular.ttf` | 16 | Rounded pixel-grid font. |
257
+ | `16_32-HomeVideo-BLG6G.ttf`, `16_32-HomeVideoBold-R90Dv.ttf` | 16 or 32 | Wider retro/VHS-style font, verified to keep readable spacing at both sizes. |
258
+ | `16_32-MayfairNbpBold-gAA4.ttf` | 16 or 32 | Bold pixel-style display font, verified to keep readable spacing at both sizes. |
259
+ | `32-Jersey10-Regular.ttf` | 32 | Retro digital/LCD-style font, verified at size 32. |
260
+ | `Rain-DRM3.otf` | any | Default font, used when no `font_path` is given. Narrow enough to stay legible across sizes. |
261
+
262
+ Pick whichever fits your desired look, but stick to the recommended `font_size`(s) listed above (or
263
+ your own tested size) for that font - otherwise characters may run into each other. Narrower fonts
264
+ (that fit within 8px wide per character at the size used) will also get tighter, more compact text
265
+ since they qualify for the 8x16 cell instead of the 16x32 one.
266
+
267
+ ### Font licenses
268
+
269
+ Each font keeps its own license, shipped next to it in `idotmatrix/fonts/`. They do not change the
270
+ license of this library's code.
271
+
272
+ | Font(s) | License |
273
+ | --- | --- |
274
+ | Rain-DRM3, Dogica, Press Start 2P, Pixelify Sans, Jersey 10 | [SIL Open Font License 1.1](https://openfontlicense.org) |
275
+ | Pixel Operator | CC0 1.0 |
276
+ | Home Video, Minecraft Standard | Public Domain |
277
+ | Erbos Draco 1st Open NBP ([source](https://www.fontspace.com/erbos-draco-monospaced-nbp-font-f14579)) | [CC BY-SA](idotmatrix/fonts/CC-BY-SA-4.0-License.txt) |
278
+ | Mayfair NBP Bold ([source](https://www.fontspace.com/mayfair-nbp-font-f15853)) | [CC BY-SA](idotmatrix/fonts/CC-BY-SA-4.0-License.txt) |
279
+
280
+ The two CC BY-SA fonts are redistributed unmodified. Copies of derived fonts must be shared under the
281
+ same license, with attribution to the original authors (see the links above).
282
+
283
+ ### Finding more fonts
284
+
285
+ When looking for additional fonts, search for:
286
+
287
+ * `pixel font` / `bitmap font`
288
+ * `8x8 font`, `5x7 font`, `dot matrix font`
289
+ * `LED font` / `LCD font`
290
+ * `retro pixel font` / `monospace pixel font`
291
+
292
+ Good sources: [dafont.com/bitmap.php](https://www.dafont.com/bitmap.php),
293
+ [fontspace.com's pixel-fonts tag](https://www.fontspace.com/pixel-fonts)
294
+
295
+ Always test a new font at the font size you intend to use before committing to it - some
296
+ pixel-style fonts are only pixel-perfect at their native design size and look uneven at others.
297
+ Check each font's license before bundling/redistributing it (see the existing `*-License.txt`
298
+ files next to each font in [`idotmatrix/fonts/`](idotmatrix/fonts/) for examples).
299
+
300
+ ## Roadmap
301
+
302
+ If you want to contribute please focus on the reverse-engineering part because my personal skills are not that good.
303
+ Many thanks for all contributions! If you want to dive deep
304
+ into other issues please check for "#TODO" comments in the source code as well.
305
+
306
+ * [ ] Reverse Engineering
307
+ * [X] Chronograph
308
+ * [X] Clock
309
+ * [X] Countdown
310
+ * [x] Graffiti Board
311
+ * [X] DIY-Mode
312
+ * [X] Animated Images
313
+ * [X] Display Text
314
+ * [ ] Alarm & Buzzer (available according to issue #18)
315
+ * [ ] Cloud-API to download images
316
+ * [ ] Cloud-API to upload images to device
317
+ * [ ] Cloud-Firmware Update possible?
318
+ * [X] Eco-Mode
319
+ * [X] Fullscreen Color
320
+ * [X] MusicSync (with the microphone of the device)
321
+ * [X] Scoreboard
322
+ * [ ] bluetooth password protection
323
+ * [ ] understand the returned byte arrays of the device for better error logs (done for the upload acknowledgements,
324
+ see the protocol notes in [AGENTS.md](./AGENTS.md))
325
+
326
+ ## Helpful Links
327
+
328
+ * Create Images or GIFs
329
+ * [pixilart](https://www.pixilart.com/draw)
330
+ * Create a new drawing and select a preset for the size of your display (e.g. 64x64)
331
+
332
+ ## Other Hardware
333
+ This software is specifically built for devices which are supported by the iDotMatrix app. There are other devices
334
+ being sold which have a similar form factor and claim to be compatible, but which are not. Below is a list of known
335
+ non-iDotMatrix-compatible hardware and associated software.
336
+ - For hardware supported by the "LOY SPACE" app: https://github.com/eskibars/popledder/
337
+
338
+ ## Contributing
339
+
340
+ Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any
341
+ contributions you make are **greatly appreciated**.
342
+
343
+ * If you have suggestions for adding or removing projects, feel free
344
+ to [open an issue](https://github.com/markusressel/python3-idotmatrix-library/issues/new) to discuss it, or
345
+ directly create a pull request after you edit the *README.md* file with necessary changes.
346
+ * Please make sure you check your spelling and grammar.
347
+ * Create individual PR for each suggestion.
348
+ * Please also read through
349
+ the [Code Of Conduct](https://github.com/markusressel/python3-idotmatrix-library/blob/main/CODE_OF_CONDUCT.md) before
350
+ posting your first idea as well.
351
+
352
+ ### Creating A Pull Request
353
+
354
+ 1. Fork the Project
355
+ 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
356
+ 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
357
+ 4. Push to the Branch (`git push origin feature/AmazingFeature`)
358
+ 5. Open a Pull Request
359
+
360
+ ## License
361
+
362
+ Distributed under the GNU GENERAL PUBLIC License.
363
+ See [LICENSE](https://github.com/markusressel/python3-idotmatrix-library/blob/main/LICENSE) for more information.
364
+
365
+ ## Acknowledgements
366
+
367
+ Original project by [derkalle4](https://github.com/derkalle4) and [jmgraeffe](https://github.com/jmgraeffe).
368
+
369
+ * [Othneil Drew](https://github.com/othneildrew/Best-README-Template) - *README Template*
370
+ * [LordRippon](https://github.com/LordRippon) - *Reverse Engineering for the Displays*
371
+ * [8none1](https://github.com/8none1) - *Reverse Engineering for the Displays*
372
+ * [schorsch3000](https://github.com/schorsch3000) - *smaller fixes*
373
+ * [tekka007](https://github.com/tekka007) - *code refactoring and reverse engineering*
374
+ * [inselberg](https://github.com/inselberg) - *Reverse Engineering for the Displays*
375
+
@@ -0,0 +1,63 @@
1
+ idotmatrix/__init__.py,sha256=eHASmKtgmDdqzPcjoi3nBhFt_MpC87TLXd0BeeWEmg8,418
2
+ idotmatrix/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ idotmatrix/apps/digital_picture_frame.py,sha256=Yn2H_9XKdQhhY6WWvIEGFlT0eYSDaJDud42WETU1t2E,21257
4
+ idotmatrix/client.py,sha256=PXBaxq5tV4XQ5UNtB3MZuMAuUReWZem_UcE1D6uWyeI,10801
5
+ idotmatrix/connection_manager.py,sha256=YwingOSiQWUF5zQVVhPdzn30hAv09zsTFZO36ox1Uow,32115
6
+ idotmatrix/const.py,sha256=ttfQAYWvalc8oKdevY6MYZ7Lo42fBO1zeeCT2MQfvEg,1408
7
+ idotmatrix/fonts/16-ErbosDraco1StOpenNbpRegular-l5wX.ttf,sha256=jnE44rrHH4T7m9y5XhA5ZaFr-QPkk3jLXYNXJhpGy3Q,29880
8
+ idotmatrix/fonts/16-MinecraftStandard.otf,sha256=pVTzOgMahfRL6b1pQtcUHNoe-PyOV-dvfQZjaAiRzCM,159732
9
+ idotmatrix/fonts/16-MinecraftStandardBoldOblique.otf,sha256=a_FMd78Uk5wvTZAoYGTUdXKCbjSroWA5aS_dznmQlQk,249536
10
+ idotmatrix/fonts/16-PixelOperator8-Bold.ttf,sha256=tGoQnNrGwvestKV0Udw8j34tORuHFQAnDq3xOfCskG4,18624
11
+ idotmatrix/fonts/16-PixelOperator8.ttf,sha256=XMy572zxiXe25XIdSaGm543WpvHE9pU3Rw99wdyCn_w,19944
12
+ idotmatrix/fonts/16-PixelifySans-Regular.ttf,sha256=SDX-f9sTqtLJCB0ctrIxfyRLKZt-ycbCdar11n3TutE,51312
13
+ idotmatrix/fonts/16-PressStart2P-Regular.ttf,sha256=F-x9JQ_1kJcabZZrT9xaoE1eOadpT0oL7LUVtqcKcig,69748
14
+ idotmatrix/fonts/16-dogica.ttf,sha256=p2d01-ec6jDWQcbHl3Id4q6BV84-vSqod6JSAfhLEFo,33860
15
+ idotmatrix/fonts/16-dogicabold.ttf,sha256=dCNawiOUdlV-SzbP5LWd938o3LWdPbA7FAMm181WV0M,31452
16
+ idotmatrix/fonts/16-dogicapixel.ttf,sha256=ycq3iW4Eo33mtk1CJOUssQ12Kml91lYWWDDej3E2Dy4,33556
17
+ idotmatrix/fonts/16-dogicapixelbold.ttf,sha256=iRWNVFqlOawg95H1LPxGSuiloicaF9xCbG-U6yfsoYc,32012
18
+ idotmatrix/fonts/16_32-HomeVideo-BLG6G.ttf,sha256=5z1n-SRXvQXSTEL0MVa8Qi6YmC6eYtJnrW0aPMWVuwE,93580
19
+ idotmatrix/fonts/16_32-HomeVideoBold-R90Dv.ttf,sha256=skDRI0cN0aHUWjWHwKIsK22EvnqZepc8IbwP_7VM5Lk,105572
20
+ idotmatrix/fonts/16_32-MayfairNbpBold-gAA4.ttf,sha256=v8LrnCFtssunbZX8oHpeZOBSnhJG0729gS80Vl3lLNk,9724
21
+ idotmatrix/fonts/32-Jersey10-Regular.ttf,sha256=1mGJKrhleT278dTZUUyi08WttbHwatMC__TQIQQt2Co,76636
22
+ idotmatrix/fonts/CC-BY-SA-4.0-License.txt,sha256=KKlSnH0LtNxR9L9cEWo9Fu8kegUvdZFGZ2jd9WP9HPU,20138
23
+ idotmatrix/fonts/ErbosDraco-License.txt,sha256=neXRKii0EOm_l9ZsEuAmS11vv8zyK0Z-ZkNQzsTK7mw,243
24
+ idotmatrix/fonts/HomeVideo-License.txt,sha256=V0p44PZqLTQdXxQTxzYvUCmQbp31qMFntuxsiZlMCbk,81
25
+ idotmatrix/fonts/Jersey10-Regular-License.txt,sha256=Q21YNgZM7Hlsfd3m-0-uq9tvLxdEOiSjDQw4t10T-SI,4395
26
+ idotmatrix/fonts/MayfairNbpBold-License.txt,sha256=AWyZz1atQXCdNAUyuzR0xW2__vx9JIcXBClFMzcMNgc,228
27
+ idotmatrix/fonts/MinecraftStandard-License.txt,sha256=CpwC_Ys8hbaoDS5OJrFwpAYMiLJU34kbXYYXtwZZbTM,486
28
+ idotmatrix/fonts/PixelOperator-License.txt,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
29
+ idotmatrix/fonts/PixelifySans-License.txt,sha256=f1TR2fGuG6nyci-XgUX5AyT-o0yjwjBLOinPqWrGA34,4395
30
+ idotmatrix/fonts/PressStart2P-Regular-License.txt,sha256=CL5TUxAvLTZaymcGuJ8PqiUfeHMTiRVcp0apN-bFEsE,4409
31
+ idotmatrix/fonts/Rain-DRM3-License.txt,sha256=17KoJGE_f6yX_n56WaqhQoQjLLW9WmUuxN9BsYO3_Ys,4396
32
+ idotmatrix/fonts/Rain-DRM3.otf,sha256=JCFWup389117V2o354PM5RfP80qJSB3cCPI74EfrkDI,85524
33
+ idotmatrix/fonts/dogica_license.txt,sha256=o2mN8wkAmcnYkQQRoocBX9tMngD-dzdLk7P0ElsXgOA,4418
34
+ idotmatrix/modules/__init__.py,sha256=mLLMKP2h_KNTNloAqTC-709eZ80XjXcPv6F4cP0QqrA,2678
35
+ idotmatrix/modules/chronograph.py,sha256=5TaBFZFrj7xlQiLQOj6f-INEWCpt93tWV92Cn3cjW6Q,1446
36
+ idotmatrix/modules/clock.py,sha256=LURVL6ByYcYossBccsxExfOg065ONdQGhmLpIN-vYnM,3395
37
+ idotmatrix/modules/common.py,sha256=pTN99GUjFLr7Gl8FvPe9aW5s3KebyLt45M50ASxHDHQ,6303
38
+ idotmatrix/modules/countdown.py,sha256=1TlLAyupOhOfPbeYuh9XseGxrDXdpT85vzSV9DRJbmA,2342
39
+ idotmatrix/modules/eco.py,sha256=1a50bMgMsfWZAnehbvlswsRq8v_WddCdtyf6-8IAmto,2441
40
+ idotmatrix/modules/effect.py,sha256=YFOvfyfRGb5vgBZpJ7FLKtiJ2xh03b_nM0ti6TaNfww,2612
41
+ idotmatrix/modules/fullscreen_color.py,sha256=Z2aQAEAYUcyiqksxpsHEhgJofR8OqnL1Croq0TdV1uE,1974
42
+ idotmatrix/modules/gif.py,sha256=BXfvzG1pPQVwpFlf8BFUCHncc7rxnR5ahVBrobpDqyo,19739
43
+ idotmatrix/modules/graffiti.py,sha256=5HMlPSywKr7ggIC2v20Sa61qKc2Hg06Gfrw3guWjYSg,2464
44
+ idotmatrix/modules/image.py,sha256=XmY1Pn48glJXLc4tpyeGPPguVNbF1IxcslJ52U4dc4g,16643
45
+ idotmatrix/modules/music_sync.py,sha256=NVCzLwMqhqaPgNIuMTbStaDuMKtJT0EnU_0gtCdZ9YA,3200
46
+ idotmatrix/modules/scoreboard.py,sha256=oyDMCOyHp6U3A2I9-fdXqrYWm8IpPFv3c3poWS5USuE,1517
47
+ idotmatrix/modules/system.py,sha256=VhWpTLxj9g627zYaqM4Z3HlRxkJhW9ygyGo_YSFiOUk,1751
48
+ idotmatrix/modules/text.py,sha256=MSvizLgkTCO9F54laJf23ND216Y0f079yE5VsvC6wNo,9245
49
+ idotmatrix/protocol.py,sha256=UyQx4aDiqSNdH6RL1bSHDT2zbWj8wN3QH4bBEijULBU,1709
50
+ idotmatrix/screensize.py,sha256=1v8ct_FBWgJI24DpwWVUQ2Ji4w0DHDlxCZjltewvTvA,159
51
+ idotmatrix/transport.py,sha256=YuJFP3ykmWhhj2pzb4QmwXvewp-iCP-8W96SXaARfko,6110
52
+ idotmatrix/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
+ idotmatrix/util/color_utils.py,sha256=SYEUYoBilZjC7Vh7HhYZFEM_gcwDfhf6bTLQe1Ox4ig,2869
54
+ idotmatrix/util/command_ack.py,sha256=nrWAmteib06UNlGIGW13DV9DxMVU8Ng3cIQD0GKco2Q,965
55
+ idotmatrix/util/device_info.py,sha256=FoWk-jrr-coBV_kB4-uEu9jOsdMd3yrPowxeKVlxC48,1363
56
+ idotmatrix/util/device_material.py,sha256=uznHNbFgSF-CSVWKvIIeNokastB6EqTIONjPdHvEbwQ,713
57
+ idotmatrix/util/file_watch.py,sha256=JOvffveBVaZnoYhB9Pr6w1bEyVQRw993XFpqkpcNtww,2270
58
+ idotmatrix/util/image_utils.py,sha256=ncO3kDWkpNJdTWB45axjXFJcobGCnQlV-eVltTzOMHI,5303
59
+ idotmatrix/util/upload_ack.py,sha256=apJYCPkiRgrFn1IjfeU8o7gY2uziklR2DOtZpxl_wW8,1451
60
+ idotmatrix_api_client-0.2.0.dist-info/METADATA,sha256=RI9LlVOzMt73iBQTRL4ZtJhmrwAm-mbEcVHcHTkHBz0,17203
61
+ idotmatrix_api_client-0.2.0.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
62
+ idotmatrix_api_client-0.2.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
63
+ idotmatrix_api_client-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.5.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any