aboutsummaryrefslogtreecommitdiff
path: root/light.py
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-08-11 12:57:57 +0200
committerlonkaars <loek@pipeframe.xyz>2021-08-11 12:57:57 +0200
commit2319806262c0880c839f923c12cb995e26dbc2c3 (patch)
treeda3a660927e04d98d068428e82ab314ec3a9255c /light.py
parentefe195d6592d5c6cc64de71fc65f85522bc45dfa (diff)
loading now?
Diffstat (limited to 'light.py')
-rw-r--r--light.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/light.py b/light.py
new file mode 100644
index 0000000..c443728
--- /dev/null
+++ b/light.py
@@ -0,0 +1,26 @@
+from homeassistant.components.light import LightEntity, ATTR_BRIGHTNESS, ATTR_COLOR_MODE
+from driver import BekenConnection, makemsg
+
+class BekenLight(LightEntity):
+ def __init__(self):
+ self._state = {
+ "on": False,
+ "brightness": 100,
+ "lamp": "white",
+ "saturation": 0,
+ "hue": 0,
+ }
+
+ @property
+ def name(self):
+ return "Beken LED"
+
+ @property
+ def is_on(self):
+ return self._state['on']
+
+ def turn_on(self, **kwargs):
+ self._state['on'] = True
+
+ def turn_off(self, **kwargs):
+ self._state['on'] = False