From 24ba5bcbafafbba07ec1f5f41107f9fb7c1c2a04 Mon Sep 17 00:00:00 2001 From: Franck Nijhof <git@frenck.dev> Date: Tue, 1 Dec 2020 17:06:49 +0100 Subject: [PATCH] Remove Ubee Router integration (ADR-0004) (#43809) --- .coveragerc | 1 - CODEOWNERS | 1 - homeassistant/components/ubee/__init__.py | 1 - .../components/ubee/device_tracker.py | 79 ------------------- homeassistant/components/ubee/manifest.json | 7 -- requirements_all.txt | 3 - 6 files changed, 92 deletions(-) delete mode 100644 homeassistant/components/ubee/__init__.py delete mode 100644 homeassistant/components/ubee/device_tracker.py delete mode 100644 homeassistant/components/ubee/manifest.json diff --git a/.coveragerc b/.coveragerc index f74bf42a7e3..522ce8172d1 100644 --- a/.coveragerc +++ b/.coveragerc @@ -959,7 +959,6 @@ omit = homeassistant/components/twilio_call/notify.py homeassistant/components/twilio_sms/notify.py homeassistant/components/twitter/notify.py - homeassistant/components/ubee/device_tracker.py homeassistant/components/ubus/device_tracker.py homeassistant/components/ue_smart_radio/media_player.py homeassistant/components/unifiled/* diff --git a/CODEOWNERS b/CODEOWNERS index 23eacec8f22..4b687e071ea 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -475,7 +475,6 @@ homeassistant/components/tts/* @pvizeli homeassistant/components/tuya/* @ollo69 homeassistant/components/twentemilieu/* @frenck homeassistant/components/twinkly/* @dr1rrb -homeassistant/components/ubee/* @mzdrale homeassistant/components/unifi/* @Kane610 homeassistant/components/unifiled/* @florisvdk homeassistant/components/upb/* @gwww diff --git a/homeassistant/components/ubee/__init__.py b/homeassistant/components/ubee/__init__.py deleted file mode 100644 index cc7b131a2bd..00000000000 --- a/homeassistant/components/ubee/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""The ubee component.""" diff --git a/homeassistant/components/ubee/device_tracker.py b/homeassistant/components/ubee/device_tracker.py deleted file mode 100644 index 266acc49c09..00000000000 --- a/homeassistant/components/ubee/device_tracker.py +++ /dev/null @@ -1,79 +0,0 @@ -"""Support for Ubee router.""" - -import logging - -from pyubee import Ubee -import voluptuous as vol - -from homeassistant.components.device_tracker import ( - DOMAIN, - PLATFORM_SCHEMA, - DeviceScanner, -) -from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME -import homeassistant.helpers.config_validation as cv - -_LOGGER = logging.getLogger(__name__) - -CONF_MODEL = "model" -DEFAULT_MODEL = "detect" - -PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( - { - vol.Required(CONF_HOST): cv.string, - vol.Required(CONF_PASSWORD): cv.string, - vol.Required(CONF_USERNAME): cv.string, - vol.Optional(CONF_MODEL, default=DEFAULT_MODEL): vol.Any( - "EVW32C-0N", - "EVW320B", - "EVW321B", - "EVW3200-Wifi", - "EVW3226@UPC", - "DVW32CB", - "DDW36C", - ), - } -) - - -def get_scanner(hass, config): - """Validate the configuration and return a Ubee scanner.""" - info = config[DOMAIN] - host = info[CONF_HOST] - username = info[CONF_USERNAME] - password = info[CONF_PASSWORD] - model = info[CONF_MODEL] - - ubee = Ubee(host, username, password, model) - if not ubee.login(): - _LOGGER.error("Login failed") - return None - - scanner = UbeeDeviceScanner(ubee) - return scanner - - -class UbeeDeviceScanner(DeviceScanner): - """This class queries a wireless Ubee router.""" - - def __init__(self, ubee): - """Initialize the Ubee scanner.""" - self._ubee = ubee - self._mac2name = {} - - def scan_devices(self): - """Scan for new devices and return a list with found device IDs.""" - devices = self._get_connected_devices() - self._mac2name = devices - return list(devices) - - def get_device_name(self, device): - """Return the name of the given device or None if we don't know.""" - return self._mac2name.get(device) - - def _get_connected_devices(self): - """List connected devices with pyubee.""" - if not self._ubee.session_active(): - self._ubee.login() - - return self._ubee.get_connected_devices() diff --git a/homeassistant/components/ubee/manifest.json b/homeassistant/components/ubee/manifest.json deleted file mode 100644 index 0603ffe8757..00000000000 --- a/homeassistant/components/ubee/manifest.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "domain": "ubee", - "name": "Ubee Router", - "documentation": "https://www.home-assistant.io/integrations/ubee", - "requirements": ["pyubee==0.10"], - "codeowners": ["@mzdrale"] -} diff --git a/requirements_all.txt b/requirements_all.txt index 6f7424c7e6e..0f5362ff7dd 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1863,9 +1863,6 @@ pytradfri[async]==7.0.4 # homeassistant.components.trafikverket_weatherstation pytrafikverket==0.1.6.2 -# homeassistant.components.ubee -pyubee==0.10 - # homeassistant.components.uptimerobot pyuptimerobot==0.0.5 -- GitLab