1
mirror of https://github.com/home-assistant/core synced 2024-09-06 10:29:55 +02:00

Remove is_standby from SwitchEntity (#51400)

This commit is contained in:
Erik Montnemery 2021-06-03 14:21:52 +02:00 committed by GitHub
parent 470514cb08
commit a6902ffd8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 12 deletions

View File

@ -2,7 +2,7 @@
import logging
from homeassistant.components.switch import DOMAIN, SwitchEntity
from homeassistant.const import STATE_OFF, STATE_ON, STATE_STANDBY
from homeassistant.const import STATE_OFF, STATE_ON
from . import ATTR_NEW, CecEntity
@ -56,11 +56,6 @@ class CecSwitchEntity(CecEntity, SwitchEntity):
"""Return True if entity is on."""
return self._state == STATE_ON
@property
def is_standby(self):
"""Return true if device is in standby."""
return self._state == STATE_OFF or self._state == STATE_STANDBY
@property
def state(self) -> str:
"""Return the cached state of device."""

View File

@ -88,7 +88,6 @@ class SwitchEntity(ToggleEntity):
"""Base class for switch entities."""
_attr_current_power_w: float | None = None
_attr_is_standby: bool | None = None
_attr_today_energy_kwh: float | None = None
@property
@ -101,11 +100,6 @@ class SwitchEntity(ToggleEntity):
"""Return the today total energy usage in kWh."""
return self._attr_today_energy_kwh
@property
def is_standby(self) -> bool | None:
"""Return true if device is in standby."""
return self._attr_is_standby
@final
@property
def state_attributes(self) -> dict[str, Any] | None: