From 00230ae122d3fd93b6cfa50fc0e504fa39ca1640 Mon Sep 17 00:00:00 2001 From: Bram Date: Mon, 7 Aug 2023 11:34:49 +0200 Subject: [PATCH] Cleanup --- custom_components/powercalc/const.py | 8 +------- custom_components/powercalc/sensors/power.py | 9 --------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/custom_components/powercalc/const.py b/custom_components/powercalc/const.py index efd3c47a2..1b7cac398 100644 --- a/custom_components/powercalc/const.py +++ b/custom_components/powercalc/const.py @@ -7,7 +7,7 @@ from homeassistant.const import __version__ as HA_VERSION # noqa if AwesomeVersion(HA_VERSION) >= AwesomeVersion("2023.8.0"): - from enum import IntFlag, StrEnum + from enum import StrEnum else: from homeassistant.backports.enum import StrEnum @@ -176,12 +176,6 @@ class UnitPrefix(StrEnum): OFF_STATES = (STATE_OFF, STATE_NOT_HOME, STATE_STANDBY, STATE_UNAVAILABLE) -class PowerCalcEntityFeature(IntFlag): - """Supported features of a powercalc entity.""" - - PLAYBOOK = 1 - - class CalculationStrategy(StrEnum): """Possible virtual power calculation strategies.""" diff --git a/custom_components/powercalc/sensors/power.py b/custom_components/powercalc/sensors/power.py index 430eed151..8ed258630 100644 --- a/custom_components/powercalc/sensors/power.py +++ b/custom_components/powercalc/sensors/power.py @@ -74,7 +74,6 @@ OFF_STATES, SIGNAL_POWER_SENSOR_STATE_CHANGE, CalculationStrategy, - PowerCalcEntityFeature, ) from custom_components.powercalc.discovery import autodiscover_model from custom_components.powercalc.errors import ( @@ -665,14 +664,6 @@ def available(self) -> bool: """Return True if entity is available.""" return self._power is not None - @property - def supported_features(self) -> PowerCalcEntityFeature: - """Flag supported features.""" - supported_features = PowerCalcEntityFeature(0) - if self._calculation_strategy == CalculationStrategy.PLAYBOOK: - supported_features |= PowerCalcEntityFeature.PLAYBOOK - return supported_features - def set_energy_sensor_attribute(self, entity_id: str) -> None: """Set the energy sensor on the state attributes.""" if self._sensor_config.get(CONF_DISABLE_EXTENDED_ATTRIBUTES):