Skip to main content

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 (17) 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-Length headers on upload responses. The upload method treats this as a failure and retries automatically.
  • All methods can raise requests.exceptions.ConnectionError if the device is unreachable.
  • File management methods operate on the /image/ directory on the device.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geekmagicweatherclockapi-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geekmagicweatherclockapi-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file geekmagicweatherclockapi-0.1.0.tar.gz.

File metadata

File hashes

Hashes for geekmagicweatherclockapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3fc2435019c799522de734c081797590aa1252fa971820ff13c5062c668c829c
MD5 b9c24a305c0d9354ffe5fe75117081ec
BLAKE2b-256 c89e0066bb9c8ff1263ad0432212c2b41c78bfe137f71aed4a4ca765baa22b93

See more details on using hashes here.

File details

Details for the file geekmagicweatherclockapi-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for geekmagicweatherclockapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 deae990770eb77fccf5fa82b84fed8ee0933e9b14c70656646c865c505415086
MD5 b35fedf13098c72c6d8342593d2424e2
BLAKE2b-256 ae499e8367e21b5c746378beab5f84ae88b4be6a663f61c2f7c0aa41fb0e0293

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page