From 1978a1fcef0ccdd26bafe932bab28b5d945513ad Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Fri, 16 Jun 2023 01:07:24 +0200 Subject: [PATCH] Remove eq3btsmart integration --- .coveragerc | 1 - CODEOWNERS | 1 - homeassistant/brands/eq3.json | 2 +- .../components/eq3btsmart/__init__.py | 1 - .../components/eq3btsmart/climate.py | 192 ------------------ homeassistant/components/eq3btsmart/const.py | 6 - .../components/eq3btsmart/manifest.json | 10 - homeassistant/generated/integrations.json | 6 - requirements_all.txt | 4 - requirements_test_all.txt | 1 - script/gen_requirements_all.py | 1 - 11 files changed, 1 insertion(+), 224 deletions(-) delete mode 100644 homeassistant/components/eq3btsmart/__init__.py delete mode 100644 homeassistant/components/eq3btsmart/climate.py delete mode 100644 homeassistant/components/eq3btsmart/const.py delete mode 100644 homeassistant/components/eq3btsmart/manifest.json diff --git a/.coveragerc b/.coveragerc index 1075c0c3e35a97..51ef7d4f94ee15 100644 --- a/.coveragerc +++ b/.coveragerc @@ -333,7 +333,6 @@ omit = homeassistant/components/epson/__init__.py homeassistant/components/epson/media_player.py homeassistant/components/epsonworkforce/sensor.py - homeassistant/components/eq3btsmart/climate.py homeassistant/components/escea/__init__.py homeassistant/components/escea/climate.py homeassistant/components/escea/discovery.py diff --git a/CODEOWNERS b/CODEOWNERS index 7b8a5ea5f87b67..60071eeeb61a10 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -354,7 +354,6 @@ build.json @home-assistant/supervisor /homeassistant/components/epson/ @pszafer /tests/components/epson/ @pszafer /homeassistant/components/epsonworkforce/ @ThaStealth -/homeassistant/components/eq3btsmart/ @rytilahti /homeassistant/components/escea/ @lazdavila /tests/components/escea/ @lazdavila /homeassistant/components/esphome/ @OttoWinter @jesserockz @kbx81 @bdraco diff --git a/homeassistant/brands/eq3.json b/homeassistant/brands/eq3.json index 4052afac277a10..f5b1c8aeb87d47 100644 --- a/homeassistant/brands/eq3.json +++ b/homeassistant/brands/eq3.json @@ -1,5 +1,5 @@ { "domain": "eq3", "name": "eQ-3", - "integrations": ["eq3btsmart", "maxcube"] + "integrations": ["maxcube"] } diff --git a/homeassistant/components/eq3btsmart/__init__.py b/homeassistant/components/eq3btsmart/__init__.py deleted file mode 100644 index f32eba6944f32f..00000000000000 --- a/homeassistant/components/eq3btsmart/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""The eq3btsmart component.""" diff --git a/homeassistant/components/eq3btsmart/climate.py b/homeassistant/components/eq3btsmart/climate.py deleted file mode 100644 index 700bc61293f84a..00000000000000 --- a/homeassistant/components/eq3btsmart/climate.py +++ /dev/null @@ -1,192 +0,0 @@ -"""Support for eQ-3 Bluetooth Smart thermostats.""" -from __future__ import annotations - -import logging -from typing import Any - -import eq3bt as eq3 -import voluptuous as vol - -from homeassistant.components.climate import ( - PLATFORM_SCHEMA, - PRESET_AWAY, - PRESET_BOOST, - PRESET_NONE, - ClimateEntity, - ClimateEntityFeature, - HVACMode, -) -from homeassistant.const import ( - ATTR_TEMPERATURE, - CONF_DEVICES, - CONF_MAC, - PRECISION_HALVES, - UnitOfTemperature, -) -from homeassistant.core import HomeAssistant -import homeassistant.helpers.config_validation as cv -from homeassistant.helpers.device_registry import format_mac -from homeassistant.helpers.entity_platform import AddEntitiesCallback -from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType - -from .const import PRESET_CLOSED, PRESET_NO_HOLD, PRESET_OPEN, PRESET_PERMANENT_HOLD - -_LOGGER = logging.getLogger(__name__) - -STATE_BOOST = "boost" - -ATTR_STATE_WINDOW_OPEN = "window_open" -ATTR_STATE_VALVE = "valve" -ATTR_STATE_LOCKED = "is_locked" -ATTR_STATE_LOW_BAT = "low_battery" -ATTR_STATE_AWAY_END = "away_end" - -EQ_TO_HA_HVAC = { - eq3.Mode.Open: HVACMode.HEAT, - eq3.Mode.Closed: HVACMode.OFF, - eq3.Mode.Auto: HVACMode.AUTO, - eq3.Mode.Manual: HVACMode.HEAT, - eq3.Mode.Boost: HVACMode.AUTO, - eq3.Mode.Away: HVACMode.HEAT, -} - -HA_TO_EQ_HVAC = { - HVACMode.HEAT: eq3.Mode.Manual, - HVACMode.OFF: eq3.Mode.Closed, - HVACMode.AUTO: eq3.Mode.Auto, -} - -EQ_TO_HA_PRESET = { - eq3.Mode.Boost: PRESET_BOOST, - eq3.Mode.Away: PRESET_AWAY, - eq3.Mode.Manual: PRESET_PERMANENT_HOLD, - eq3.Mode.Auto: PRESET_NO_HOLD, - eq3.Mode.Open: PRESET_OPEN, - eq3.Mode.Closed: PRESET_CLOSED, -} - -HA_TO_EQ_PRESET = { - PRESET_BOOST: eq3.Mode.Boost, - PRESET_AWAY: eq3.Mode.Away, - PRESET_PERMANENT_HOLD: eq3.Mode.Manual, - PRESET_NO_HOLD: eq3.Mode.Auto, - PRESET_OPEN: eq3.Mode.Open, - PRESET_CLOSED: eq3.Mode.Closed, -} - - -DEVICE_SCHEMA = vol.Schema({vol.Required(CONF_MAC): cv.string}) - -PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( - {vol.Required(CONF_DEVICES): vol.Schema({cv.string: DEVICE_SCHEMA})} -) - - -def setup_platform( - hass: HomeAssistant, - config: ConfigType, - add_entities: AddEntitiesCallback, - discovery_info: DiscoveryInfoType | None = None, -) -> None: - """Set up the eQ-3 BLE thermostats.""" - devices = [] - - for name, device_cfg in config[CONF_DEVICES].items(): - mac = device_cfg[CONF_MAC] - devices.append(EQ3BTSmartThermostat(mac, name)) - - add_entities(devices, True) - - -class EQ3BTSmartThermostat(ClimateEntity): - """Representation of an eQ-3 Bluetooth Smart thermostat.""" - - _attr_hvac_modes = list(HA_TO_EQ_HVAC) - _attr_precision = PRECISION_HALVES - _attr_preset_modes = list(HA_TO_EQ_PRESET) - _attr_supported_features = ( - ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE - ) - _attr_temperature_unit = UnitOfTemperature.CELSIUS - - def __init__(self, mac: str, name: str) -> None: - """Initialize the thermostat.""" - # We want to avoid name clash with this module. - self._attr_name = name - self._attr_unique_id = format_mac(mac) - self._thermostat = eq3.Thermostat(mac) - - @property - def available(self) -> bool: - """Return if thermostat is available.""" - return self._thermostat.mode >= 0 - - @property - def current_temperature(self): - """Can not report temperature, so return target_temperature.""" - return self.target_temperature - - @property - def target_temperature(self): - """Return the temperature we try to reach.""" - return self._thermostat.target_temperature - - def set_temperature(self, **kwargs: Any) -> None: - """Set new target temperature.""" - if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None: - return - self._thermostat.target_temperature = temperature - - @property - def hvac_mode(self) -> HVACMode: - """Return the current operation mode.""" - if self._thermostat.mode < 0: - return HVACMode.OFF - return EQ_TO_HA_HVAC[self._thermostat.mode] - - def set_hvac_mode(self, hvac_mode: HVACMode) -> None: - """Set operation mode.""" - self._thermostat.mode = HA_TO_EQ_HVAC[hvac_mode] - - @property - def min_temp(self): - """Return the minimum temperature.""" - return self._thermostat.min_temp - - @property - def max_temp(self): - """Return the maximum temperature.""" - return self._thermostat.max_temp - - @property - def extra_state_attributes(self) -> dict[str, Any]: - """Return the device specific state attributes.""" - return { - ATTR_STATE_AWAY_END: self._thermostat.away_end, - ATTR_STATE_LOCKED: self._thermostat.locked, - ATTR_STATE_LOW_BAT: self._thermostat.low_battery, - ATTR_STATE_VALVE: self._thermostat.valve_state, - ATTR_STATE_WINDOW_OPEN: self._thermostat.window_open, - } - - @property - def preset_mode(self) -> str | None: - """Return the current preset mode, e.g., home, away, temp. - - Requires ClimateEntityFeature.PRESET_MODE. - """ - return EQ_TO_HA_PRESET.get(self._thermostat.mode) - - def set_preset_mode(self, preset_mode: str) -> None: - """Set new preset mode.""" - if preset_mode == PRESET_NONE: - self.set_hvac_mode(HVACMode.HEAT) - self._thermostat.mode = HA_TO_EQ_PRESET[preset_mode] - - def update(self) -> None: - """Update the data from the thermostat.""" - - try: - self._thermostat.update() - except eq3.BackendException as ex: - _LOGGER.warning("Updating the state failed: %s", ex) diff --git a/homeassistant/components/eq3btsmart/const.py b/homeassistant/components/eq3btsmart/const.py deleted file mode 100644 index af90acbde551de..00000000000000 --- a/homeassistant/components/eq3btsmart/const.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Constants for EQ3 Bluetooth Smart Radiator Valves.""" - -PRESET_PERMANENT_HOLD = "permanent_hold" -PRESET_NO_HOLD = "no_hold" -PRESET_OPEN = "open" -PRESET_CLOSED = "closed" diff --git a/homeassistant/components/eq3btsmart/manifest.json b/homeassistant/components/eq3btsmart/manifest.json deleted file mode 100644 index 8a976b25c7a5c6..00000000000000 --- a/homeassistant/components/eq3btsmart/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "domain": "eq3btsmart", - "name": "eQ-3 Bluetooth Smart Thermostats", - "codeowners": ["@rytilahti"], - "dependencies": ["bluetooth_adapters"], - "documentation": "https://www.home-assistant.io/integrations/eq3btsmart", - "iot_class": "local_polling", - "loggers": ["bleak", "eq3bt"], - "requirements": ["construct==2.10.68", "python-eq3bt==0.2"] -} diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index bfd7a869089671..312a2838051370 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -1552,12 +1552,6 @@ "eq3": { "name": "eQ-3", "integrations": { - "eq3btsmart": { - "integration_type": "hub", - "config_flow": false, - "iot_class": "local_polling", - "name": "eQ-3 Bluetooth Smart Thermostats" - }, "maxcube": { "integration_type": "hub", "config_flow": false, diff --git a/requirements_all.txt b/requirements_all.txt index bb6468323619cb..77ce0c4b237ddf 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -636,7 +636,6 @@ concord232==0.15 # homeassistant.components.upc_connect connect-box==0.2.8 -# homeassistant.components.eq3btsmart # homeassistant.components.xiaomi_miio construct==2.10.68 @@ -2130,9 +2129,6 @@ python-digitalocean==1.13.2 # homeassistant.components.ecobee python-ecobee-api==0.2.17 -# homeassistant.components.eq3btsmart -# python-eq3bt==0.2 - # homeassistant.components.etherscan python-etherscan-api==0.0.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index f0c22d7ed25930..dc49c358a8c653 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -517,7 +517,6 @@ colorlog==6.7.0 # homeassistant.components.color_extractor colorthief==0.2.1 -# homeassistant.components.eq3btsmart # homeassistant.components.xiaomi_miio construct==2.10.68 diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index f62d6e936a75a1..f6835fdbaf147f 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -32,7 +32,6 @@ "pybluez", "pycocotools", "pycups", - "python-eq3bt", "python-gammu", "python-lirc", "pyuserinput",