Define RemoteEntity entity attributes as class variables (#51904)

This commit is contained in:
Franck Nijhof 2021-06-17 10:21:49 +02:00 committed by GitHub
parent 9f17b8856a
commit 17a71020db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,20 +145,24 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
class RemoteEntity(ToggleEntity):
"""Base class for remote entities."""
_attr_activity_list: list[str] | None = None
_attr_current_activity: str | None = None
_attr_supported_features: int = 0
@property
def supported_features(self) -> int:
"""Flag supported features."""
return 0
return self._attr_supported_features
@property
def current_activity(self) -> str | None:
"""Active activity."""
return None
return self._attr_current_activity
@property
def activity_list(self) -> list[str] | None:
"""List of available activities."""
return None
return self._attr_activity_list
@final
@property