-
Notifications
You must be signed in to change notification settings - Fork 2
/
lightstate.py
35 lines (31 loc) · 925 Bytes
/
lightstate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
#!/usr/bin/env python
"""
@author: Noah Norman
"""
class LightState(object):
def __init__(self, name, bright, start,
hue=None, sat=None, kelvin=None):
self.name = name
self.bright = bright
self.start = start
self.hue = hue
self.sat = sat
self.kelvin = kelvin
if hue is None:
self.type = "white"
else:
self.type = "color"
def __repr__(self):
rep = "///LS NAME: {}, ".format(self.name)
rep += "bright: {}, ".format(self.bright)
rep += "start: {}, ".format(self.start)
rep += "hue: {}, ".format(self.hue)
rep += "sat: {}, ".format(self.sat)
rep += "kelvin: {} ".format(self.kelvin)
return rep
def is_color(self):
return self.type is "color"
def is_white(self):
return self.type is "white"