From 930ddb1933b0953e73e9529121d0942bcd939e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?So=CC=88ren=20Mu=CC=88ller?= Date: Mon, 3 Jun 2019 17:43:02 +0200 Subject: [PATCH] Revert "Adds Elgato Avea integration" This reverts commit 8607a685eb47e99ea0e8a69fbdb84e511aaf1be0. --- homeassistant/components/avea/__init__.py | 1 - homeassistant/components/avea/light.py | 92 --------------------- homeassistant/components/avea/manifest.json | 8 -- 3 files changed, 101 deletions(-) delete mode 100644 homeassistant/components/avea/__init__.py delete mode 100644 homeassistant/components/avea/light.py delete mode 100644 homeassistant/components/avea/manifest.json diff --git a/homeassistant/components/avea/__init__.py b/homeassistant/components/avea/__init__.py deleted file mode 100644 index 861c4f655a1..00000000000 --- a/homeassistant/components/avea/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""The avea component.""" diff --git a/homeassistant/components/avea/light.py b/homeassistant/components/avea/light.py deleted file mode 100644 index ecd3ce99817..00000000000 --- a/homeassistant/components/avea/light.py +++ /dev/null @@ -1,92 +0,0 @@ -import logging -from random import randint -import voluptuous as vol - -from homeassistant.components.light import ATTR_BRIGHTNESS, ATTR_HS_COLOR, ATTR_RGB_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, Light, PLATFORM_SCHEMA -import homeassistant.helpers.config_validation as cv -import homeassistant.util.color as color_util - - -_LOGGER = logging.getLogger(__name__) - -SUPPORT_AVEA = (SUPPORT_BRIGHTNESS | SUPPORT_COLOR) - - -def setup_platform(hass, config, add_devices, discovery_info=None): - """Setup the Avea platform.""" - import avea - - nearbyBulbs = avea.discover_avea_bulbs() - - add_devices(AveaLight(bulb) for bulb in nearbyBulbs) - -class AveaLight(Light): - """Representation of an Avea.""" - - def __init__(self, light): - """Initialize an AveaLigh.""" - self._light = light - self._name = light.get_name() - if int(light.get_brightness()) == 0: - self._state = False - else: - self._state = True - self._brightness = round(255 * (light.get_brightness() / 100)) - - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_AVEA - - @property - def name(self): - """Return the display name of this light.""" - return self._name - - @property - def brightness(self): - """Return the brightness of the light. - - This method is optional. Removing it indicates to Home Assistant - that brightness is not supported for this light. - """ - return self._brightness - - @property - def is_on(self): - """Return true if light is on.""" - return self._state - - def turn_on(self, **kwargs): - """Instruct the light to turn on. - - You can skip the brightness part if your light does not support - brightness control. - """ - if not kwargs: - self._light.set_brightness(4095); - else: - if ATTR_BRIGHTNESS in kwargs: - bright_percent = round((kwargs.get(ATTR_BRIGHTNESS, 255)/255)*100) - self._light.set_brightness(round(4095 * (bright_percent / 100))); - if ATTR_HS_COLOR in kwargs: - _LOGGER.error("ATTR_HS_COLOR!") - rgb = color_util.color_hs_to_RGB(*kwargs[ATTR_HS_COLOR]) - self._light.set_rgb(round(255 * (rgb[0] / 100)), round(255 * (rgb[1] / 100)), round(255 * (rgb[2] / 100))); - - - def turn_off(self, **kwargs): - """Instruct the light to turn off.""" - self._light.set_brightness(0); - - def update(self): - """Fetch new state data for this light. - - This is the only method that should fetch new data for Home Assistant. - """ - if self._light.get_brightness() == 0: - self._state = False - else: - self._state = True - bright_percent = round((self._light.get_brightness()/4095)*100) - self._brightness = round(255 * (bright_percent / 100)) \ No newline at end of file diff --git a/homeassistant/components/avea/manifest.json b/homeassistant/components/avea/manifest.json deleted file mode 100644 index 273cefcbcfa..00000000000 --- a/homeassistant/components/avea/manifest.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "domain": "avea", - "name": "Elgato Avea", - "documentation": "https://www.home-assistant.io/components/avea", - "dependencies": [], - "codeowners": ["@pattyland"], - "requirements": ["avea==1.2.8"] -} \ No newline at end of file