diff --git a/.coveragerc b/.coveragerc index 06a0f84e032..713f7e98cc3 100644 --- a/.coveragerc +++ b/.coveragerc @@ -701,7 +701,6 @@ omit = homeassistant/components/neato/switch.py homeassistant/components/neato/vacuum.py homeassistant/components/nederlandse_spoorwegen/sensor.py - homeassistant/components/nello/lock.py homeassistant/components/nest/legacy/* homeassistant/components/netdata/sensor.py homeassistant/components/netgear/__init__.py diff --git a/CODEOWNERS b/CODEOWNERS index 3f67d50ccd0..79a602545d7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -337,7 +337,6 @@ homeassistant/components/nam/* @bieniu homeassistant/components/nanoleaf/* @milanmeu homeassistant/components/neato/* @dshokouhi @Santobert homeassistant/components/nederlandse_spoorwegen/* @YarmoM -homeassistant/components/nello/* @pschmitt homeassistant/components/ness_alarm/* @nickw444 homeassistant/components/nest/* @allenporter homeassistant/components/netatmo/* @cgtobi diff --git a/homeassistant/components/nello/__init__.py b/homeassistant/components/nello/__init__.py deleted file mode 100644 index dfe556f7f29..00000000000 --- a/homeassistant/components/nello/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""The nello component.""" diff --git a/homeassistant/components/nello/lock.py b/homeassistant/components/nello/lock.py deleted file mode 100644 index 93e63b05da9..00000000000 --- a/homeassistant/components/nello/lock.py +++ /dev/null @@ -1,97 +0,0 @@ -"""Nello.io lock platform.""" -from itertools import filterfalse -import logging - -from pynello.private import Nello -import voluptuous as vol - -from homeassistant.components.lock import PLATFORM_SCHEMA, SUPPORT_OPEN, LockEntity -from homeassistant.const import CONF_PASSWORD, CONF_USERNAME -import homeassistant.helpers.config_validation as cv - -_LOGGER = logging.getLogger(__name__) - -ATTR_ADDRESS = "address" -ATTR_LOCATION_ID = "location_id" -EVENT_DOOR_BELL = "nello_bell_ring" - -PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( - {vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string} -) - - -def setup_platform(hass, config, add_entities, discovery_info=None): - """Set up the Nello lock platform.""" - - nello = Nello(config.get(CONF_USERNAME), config.get(CONF_PASSWORD)) - add_entities([NelloLock(lock) for lock in nello.locations], True) - - -class NelloLock(LockEntity): - """Representation of a Nello lock.""" - - def __init__(self, nello_lock): - """Initialize the lock.""" - self._nello_lock = nello_lock - self._device_attrs = None - self._activity = None - self._name = None - - @property - def name(self): - """Return the name of the lock.""" - return self._name - - @property - def is_locked(self): - """Return true if lock is locked.""" - return True - - @property - def extra_state_attributes(self): - """Return the device specific state attributes.""" - return self._device_attrs - - def update(self): - """Update the nello lock properties.""" - self._nello_lock.update() - # Location identifiers - location_id = self._nello_lock.location_id - short_id = self._nello_lock.short_id - address = self._nello_lock.address - self._name = f"Nello {short_id}" - self._device_attrs = {ATTR_ADDRESS: address, ATTR_LOCATION_ID: location_id} - # Process recent activity - activity = self._nello_lock.activity - if self._activity: - # Filter out old events - new_activity = list(filterfalse(lambda x: x in self._activity, activity)) - if new_activity: - for act in new_activity: - activity_type = act.get("type") - if activity_type == "bell.ring.denied": - event_data = { - "address": address, - "date": act.get("date"), - "description": act.get("description"), - "location_id": location_id, - "short_id": short_id, - } - self.hass.bus.fire(EVENT_DOOR_BELL, event_data) - # Save the activity history so that we don't trigger an event twice - self._activity = activity - - def unlock(self, **kwargs): - """Unlock the device.""" - if not self._nello_lock.open_door(): - _LOGGER.error("Failed to unlock") - - def open(self, **kwargs): - """Unlock the device.""" - if not self._nello_lock.open_door(): - _LOGGER.error("Failed to open") - - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_OPEN diff --git a/homeassistant/components/nello/manifest.json b/homeassistant/components/nello/manifest.json deleted file mode 100644 index 790b8610543..00000000000 --- a/homeassistant/components/nello/manifest.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "domain": "nello", - "name": "Nello", - "documentation": "https://www.home-assistant.io/integrations/nello", - "requirements": ["pynello==2.0.3"], - "codeowners": ["@pschmitt"], - "iot_class": "cloud_polling" -} diff --git a/requirements_all.txt b/requirements_all.txt index 281b47e3471..d40d4f7d2d2 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1651,9 +1651,6 @@ pymyq==3.1.4 # homeassistant.components.mysensors pymysensors==0.21.0 -# homeassistant.components.nello -pynello==2.0.3 - # homeassistant.components.netgear pynetgear==0.7.0