diff --git a/.coveragerc b/.coveragerc index dcc26036c46..b55fe3f5a3e 100644 --- a/.coveragerc +++ b/.coveragerc @@ -335,7 +335,6 @@ omit = homeassistant/components/garmin_connect/alarm_util.py homeassistant/components/gc100/* homeassistant/components/geniushub/* - homeassistant/components/geizhals/sensor.py homeassistant/components/github/sensor.py homeassistant/components/gitlab_ci/sensor.py homeassistant/components/gitter/sensor.py diff --git a/homeassistant/components/geizhals/__init__.py b/homeassistant/components/geizhals/__init__.py deleted file mode 100644 index 28b1d623073..00000000000 --- a/homeassistant/components/geizhals/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""The geizhals component.""" diff --git a/homeassistant/components/geizhals/manifest.json b/homeassistant/components/geizhals/manifest.json deleted file mode 100644 index 17b4b5e9df0..00000000000 --- a/homeassistant/components/geizhals/manifest.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "domain": "geizhals", - "name": "Geizhals", - "documentation": "https://www.home-assistant.io/integrations/geizhals", - "requirements": ["geizhals==0.0.9"], - "codeowners": [] -} diff --git a/homeassistant/components/geizhals/sensor.py b/homeassistant/components/geizhals/sensor.py deleted file mode 100644 index 94d329a417e..00000000000 --- a/homeassistant/components/geizhals/sensor.py +++ /dev/null @@ -1,92 +0,0 @@ -"""Parse prices of a device from geizhals.""" -from datetime import timedelta - -from geizhals import Device, Geizhals -import voluptuous as vol - -from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity -from homeassistant.const import CONF_DESCRIPTION, CONF_NAME -import homeassistant.helpers.config_validation as cv -from homeassistant.util import Throttle - -CONF_PRODUCT_ID = "product_id" -CONF_LOCALE = "locale" - -ICON = "mdi:currency-usd-circle" - -MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=120) - -PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( - { - vol.Required(CONF_NAME): cv.string, - vol.Required(CONF_PRODUCT_ID): cv.positive_int, - vol.Optional(CONF_DESCRIPTION, default="Price"): cv.string, - vol.Optional(CONF_LOCALE, default="DE"): vol.In(["AT", "EU", "DE", "UK", "PL"]), - } -) - - -def setup_platform(hass, config, add_entities, discovery_info=None): - """Set up the Geizwatch sensor.""" - name = config.get(CONF_NAME) - description = config.get(CONF_DESCRIPTION) - product_id = config.get(CONF_PRODUCT_ID) - domain = config.get(CONF_LOCALE) - - add_entities([Geizwatch(name, description, product_id, domain)], True) - - -class Geizwatch(SensorEntity): - """Implementation of Geizwatch.""" - - def __init__(self, name, description, product_id, domain): - """Initialize the sensor.""" - - # internal - self._name = name - self._geizhals = Geizhals(product_id, domain) - self._device = Device() - - # external - self.description = description - self.product_id = product_id - - @property - def name(self): - """Return the name of the sensor.""" - return self._name - - @property - def icon(self): - """Return the icon for the frontend.""" - return ICON - - @property - def state(self): - """Return the best price of the selected product.""" - if not self._device.prices: - return None - - return self._device.prices[0] - - @property - def extra_state_attributes(self): - """Return the state attributes.""" - while len(self._device.prices) < 4: - self._device.prices.append("None") - attrs = { - "device_name": self._device.name, - "description": self.description, - "unit_of_measurement": self._device.price_currency, - "product_id": self.product_id, - "price1": self._device.prices[0], - "price2": self._device.prices[1], - "price3": self._device.prices[2], - "price4": self._device.prices[3], - } - return attrs - - @Throttle(MIN_TIME_BETWEEN_UPDATES) - def update(self): - """Get the latest price from geizhals and updates the state.""" - self._device = self._geizhals.parse() diff --git a/requirements_all.txt b/requirements_all.txt index 4a112c35362..d5cce464db9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -628,9 +628,6 @@ gTTS==2.2.2 # homeassistant.components.garmin_connect garminconnect==0.1.19 -# homeassistant.components.geizhals -geizhals==0.0.9 - # homeassistant.components.geniushub geniushub-client==0.6.30