Don't override methods marked as final ()

pull/57532/head
Marc Mueller 2021-10-11 15:24:06 +02:00 committed by GitHub
parent a827521138
commit 748d915909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 38 deletions
homeassistant/components
blebox
deluge
generic_hygrostat
hikvisioncam
homekit_controller
litterrobot
transmission

View File

@ -35,11 +35,6 @@ class BleBoxCoverEntity(BleBoxEntity, CoverEntity):
stop = SUPPORT_STOP if feature.has_stop else 0
self._attr_supported_features = position | stop | SUPPORT_OPEN | SUPPORT_CLOSE
@property
def state(self):
"""Return the equivalent HA cover state."""
return BLEBOX_TO_HASS_COVER_STATES[self._feature.state]
@property
def current_cover_position(self):
"""Return the current cover position."""
@ -83,5 +78,5 @@ class BleBoxCoverEntity(BleBoxEntity, CoverEntity):
await self._feature.async_stop()
def _is_state(self, state_name):
value = self.state
value = BLEBOX_TO_HASS_COVER_STATES[self._feature.state]
return None if value is None else value == state_name

View File

@ -68,11 +68,6 @@ class DelugeSwitch(ToggleEntity):
"""Return the name of the switch."""
return self._name
@property
def state(self):
"""Return the state of the device."""
return self._state
@property
def is_on(self):
"""Return true if device is on."""

View File

@ -59,11 +59,6 @@ class EvoDHW(EvoChild, WaterHeaterEntity):
self._precision = PRECISION_TENTHS if evo_broker.client_v1 else PRECISION_WHOLE
self._supported_features = SUPPORT_AWAY_MODE | SUPPORT_OPERATION_MODE
@property
def state(self):
"""Return the current state."""
return EVO_STATE_TO_HA[self._evo_device.stateStatus["state"]]
@property
def current_operation(self) -> str:
"""Return the current operating mode (Auto, On, or Off)."""

View File

@ -204,14 +204,11 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity):
return self._active
@property
def state_attributes(self):
def extra_state_attributes(self):
"""Return the optional state attributes."""
data = super().state_attributes
if self._saved_target_humidity:
data[ATTR_SAVED_HUMIDITY] = self._saved_target_humidity
return data
return {ATTR_SAVED_HUMIDITY: self._saved_target_humidity}
return None
@property
def should_poll(self):

View File

@ -73,11 +73,6 @@ class HikvisionMotionSwitch(SwitchEntity):
"""Return the name of the device if any."""
return self._name
@property
def state(self):
"""Return the state of the device if any."""
return self._state
@property
def is_on(self):
"""Return true if device is on."""

View File

@ -73,7 +73,7 @@ class HomeKitGarageDoorCover(HomeKitEntity, CoverEntity):
return SUPPORT_OPEN | SUPPORT_CLOSE
@property
def state(self):
def _state(self):
"""Return the current state of the garage door."""
value = self.service.value(CharacteristicsTypes.DOOR_STATE_CURRENT)
return CURRENT_GARAGE_STATE_MAP[value]
@ -81,17 +81,17 @@ class HomeKitGarageDoorCover(HomeKitEntity, CoverEntity):
@property
def is_closed(self):
"""Return true if cover is closed, else False."""
return self.state == STATE_CLOSED
return self._state == STATE_CLOSED
@property
def is_closing(self):
"""Return if the cover is closing or not."""
return self.state == STATE_CLOSING
return self._state == STATE_CLOSING
@property
def is_opening(self):
"""Return if the cover is opening or not."""
return self.state == STATE_OPENING
return self._state == STATE_OPENING
async def async_open_cover(self, **kwargs):
"""Send open command."""

View File

@ -17,7 +17,7 @@ from homeassistant.components.vacuum import (
SUPPORT_STATUS,
SUPPORT_TURN_OFF,
SUPPORT_TURN_ON,
VacuumEntity,
StateVacuumEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_OFF
@ -76,7 +76,7 @@ async def async_setup_entry(
)
class LitterRobotCleaner(LitterRobotControlEntity, VacuumEntity):
class LitterRobotCleaner(LitterRobotControlEntity, StateVacuumEntity):
"""Litter-Robot "Vacuum" Cleaner."""
@property

View File

@ -47,11 +47,6 @@ class TransmissionSwitch(ToggleEntity):
"""Return the unique id of the entity."""
return f"{self._tm_client.api.host}-{self.name}"
@property
def state(self):
"""Return the state of the device."""
return self._state
@property
def should_poll(self):
"""Poll for status regularly."""