From 2319806262c0880c839f923c12cb995e26dbc2c3 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 11 Aug 2021 12:57:57 +0200 Subject: loading now? --- __init__.py | 5 +++++ light.py | 26 ++++++++++++++++++++++++++ manifest.json | 11 +++++++++++ 3 files changed, 42 insertions(+) create mode 100644 __init__.py create mode 100644 light.py create mode 100644 manifest.json diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..40b4d90 --- /dev/null +++ b/__init__.py @@ -0,0 +1,5 @@ +DOMAIN = "beken" + +def setup(hass, config): + hass.states.set("beken.loaded", "yes") + return True 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 diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..e104978 --- /dev/null +++ b/manifest.json @@ -0,0 +1,11 @@ +{ + "domain": "beken", + "name": "Beken", + "documentation": "https://github.com/lonkaars/homebridge-beken", + "issue_tracker": "https://github.com/lonkaars/homebridge-beken", + "codeowners": [ "@lonkaars" ], + "version": "0.2.0", + "requirements": [], + "iot_class": "cloud_polling" +} + -- cgit v1.2.3