File: example-bulb-hsv.py

package info (click to toggle)
python-mystrom 2.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 188 kB
  • sloc: python: 855; makefile: 3
file content (18 lines) | stat: -rw-r--r-- 411 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Example code for communicating with a myStrom bulb and HSV values."""
import time

from pymystrom import bulb

bulb = bulb.MyStromBulb("192.168.0.51", "5CCF7FA0AFB0")

bulb.set_color_hex("000000FF")

# Get the details of the bulb
print("Current color details:", bulb.get_color())

# Set color as HSV (Hue, Saturation, Value)
bulb.set_color_hsv(50, 100, 100)
time.sleep(3)

# Shutdown the bulb
bulb.set_off()