Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed Aug 7, 2023
1 parent 2421300 commit 00230ae
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
8 changes: 1 addition & 7 deletions custom_components/powercalc/const.py
Expand Up @@ -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

Expand Down Expand Up @@ -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."""

Expand Down
9 changes: 0 additions & 9 deletions custom_components/powercalc/sensors/power.py
Expand Up @@ -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 (
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 00230ae

Please sign in to comment.