aboutsummaryrefslogtreecommitdiff
path: root/light.py
blob: c4437285dedd7c6e26ad676d5fbcc4d080c17bec (plain)
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
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