File: example-bulb-hsv.py

package info (click to toggle)
python-mystrom 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 292 kB
  • sloc: python: 901; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 412 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""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()