Python wrapper for controlling the GeekMagic SmallTV
Project description
GeekMagicWeatherClockAPI
A simple Python wrapper for controlling the GeekMagic SmallTV over your local network. Supports uploading images/GIFs, switching themes, adjusting brightness, and managing files on the device.
Installation
pip install GeekMagicWeatherClockAPI
Requirements
- Python 3.7+
requests(installed automatically)
Setup
Find your SmallTV's local IP address (check your router's device list or the SmallTV's settings menu), then:
from GeekMagicWeatherClockAPI import SmallTV
tv = SmallTV("192.168.1.85")
Usage
Upload an image
tv.upload("my_animation.gif")
tv.upload("my_animation.gif", retries=5) # Custom retry count
Display an image
tv.set_image("my_animation.gif")
Upload and immediately display
tv.upload_and_set("my_animation.gif")
Replace an image
tv.replace("old_animation.gif", "new_animation.gif")
Delete an image
tv.delete("my_animation.gif")
Set brightness
Accepts a value from 0 to 100.
tv.set_brightness(75)
Set theme
Accepts either an integer (1–7) or the theme name as a string (case-insensitive).
tv.set_theme(3)
tv.set_theme("Photo Album")
| ID | Theme Name |
|---|---|
| 1 | Weather Clock Today |
| 2 | Weather Forecast |
| 3 | Photo Album |
| 4 | Time Style 1 |
| 5 | Time Style 2 |
| 6 | Time Style 3 |
| 7 | Simple Weather Clock |
Full Example
from GeekMagicWeatherClockAPI import SmallTV
tv = SmallTV("192.168.1.85")
tv.upload_and_set("spaceman.gif")
tv.set_brightness(30)
tv.set_theme("Weather Clock Today")
tv.replace("spaceman.gif", "new_image.gif")
tv.delete("new_image.gif")
Notes
- The SmallTV firmware occasionally returns malformed
Content-Lengthheaders on upload responses. Theuploadmethod treats this as a failure and retries automatically. - All methods can raise
requests.exceptions.ConnectionErrorif the device is unreachable. - File management methods operate on the
/image/directory on the device.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geekmagicweatherclockapi-0.1.0.tar.gz.
File metadata
- Download URL: geekmagicweatherclockapi-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fc2435019c799522de734c081797590aa1252fa971820ff13c5062c668c829c
|
|
| MD5 |
b9c24a305c0d9354ffe5fe75117081ec
|
|
| BLAKE2b-256 |
c89e0066bb9c8ff1263ad0432212c2b41c78bfe137f71aed4a4ca765baa22b93
|
File details
Details for the file geekmagicweatherclockapi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: geekmagicweatherclockapi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
deae990770eb77fccf5fa82b84fed8ee0933e9b14c70656646c865c505415086
|
|
| MD5 |
b35fedf13098c72c6d8342593d2424e2
|
|
| BLAKE2b-256 |
ae499e8367e21b5c746378beab5f84ae88b4be6a663f61c2f7c0aa41fb0e0293
|