Rename RemoteDevice to RemoteEntity (#34676)

This commit is contained in:
Erik Montnemery authored and GitHub committed 2020-04-26 02:12:36 +02:00
1 parent d3ed80cf53
commit aa60d362fd
10 files changed
+36 -14

No files matched your search

+13 -1
View File
@@ -122,7 +122,7 @@ async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry) -> boo
return await cast(EntityComponent, hass.data[DOMAIN]).async_unload_entry(entry)
class RemoteDevice(ToggleEntity):
class RemoteEntity(ToggleEntity):
"""Representation of a remote."""
@property
@@ -149,3 +149,15 @@ class RemoteDevice(ToggleEntity):
"""Learn a command from a device."""
assert self.hass is not None
await self.hass.async_add_executor_job(ft.partial(self.learn_command, **kwargs))
class RemoteDevice(RemoteEntity):
"""Representation of a remote (for backwards compatibility)."""
def __init_subclass__(cls, **kwargs):
"""Print deprecation warning."""
super().__init_subclass__(**kwargs)
_LOGGER.warning(
"RemoteDevice is deprecated, modify %s to extend RemoteEntity",
cls.__name__,
)