Repository navigation
0.2.0
This is the first release on PyPI (pip install idotmatrix-api-client). It collects the reliability work, the protocol research and the groundwork for the Home Assistant integration ha-idotmatrix.
Breaking changes
idotmatrix.digital_picture_framemoved toidotmatrix.apps.digital_picture_frame. The old path is gone.ConnectionManager.client(the rawBleakClient) is gone. The connection goes through aTransportnow, see below.IDotMatrixClient(screen_size=...)is optional now, which is not breaking, but thescreen_sizeproperty raises aRuntimeErroruntil the size is known (see below).
Reliable uploads
- Images and GIFs wait for the acknowledgement of every 4096 byte chunk, like the official app. Before, the device dropped or garbled data, and animations stuttered or lost frames.
- All frames of a GIF get color tables of the same size, which the device needs to play them correctly.
- Photos are shown with
ImageModule.show_image_file(the "static image" upload of the app), which needs no mode switching. The picture frame uses it and can mix photos and GIFs freely. - The BLE packet size follows the negotiated MTU, which fixes uploads on macOS and other stacks with a small MTU.
show_image_file(png=True)is an experimental opt-in that sends a PNG instead of raw pixels, which is a little faster. Tested on a 64x64 only.
Talking to the device
- Commands are acknowledged and the library waits for the acknowledgement of the commands that are known to be acknowledged. A rejected command raises
CommandRejectedError. - A heartbeat (
set_heartbeat) notices a link that died without Bluetooth noticing, f.e. an unplugged display, and can reconnect. CommonModule.get_device_info()returns the firmware version, the screen type and the password flag, which the device sends as the reply to the set time command.IDotMatrixClient(screen_size=None)asks the device for its screen size when connecting (detect_screen_size()).MusicSyncworks with the microphone of the display (set_mic_type).
Internals
idotmatrix/transport.py: aTransportprotocol andBleakTransport.ConnectionManager(transport_factory=...)andIDotMatrixClient(transport_factory=...)allow another way of connecting, andtests/fake_transport.pysimulates a display for tests.idotmatrix/protocol.py: a table of the known commands andbuild_command, which writes the length bytes.- Images, GIFs and fonts are loaded in a thread, so the event loop is not blocked.
docs/DEVICE-PROTOCOL.mdcollects everything known about the protocol, marked as verified, from the app, claimed or guessed.- 339 tests, 94 % line coverage, CI for Python 3.12 to 3.14.
For Home Assistant and other Bluetooth stacks
BleakTransportandIDotMatrixClient(ble_device=...)take aBLEDeviceinstead of an address,BleakTransport(connector=...)connects withbleak-retry-connector, andinstall_signal_handlers=Falseleaves SIGINT and SIGTERM alone. See the README.
Fixes
connect()without an address no longer deadlocks, and it no longer notifies the listeners when it is already connected.- The folder watching of the picture frame works, and removing a picture no longer skips the next one.
- Color parsing:
#fffshorthand, length checks, named colors without matplotlib. - Dropped the
asyncioandmatplotlibdependencies.
Thanks to everybody who contributed to the fork: compact fonts and font selection, MTU aware fragmentation, multi-pixel graffiti, light effects, reset and chunked GIF uploads.