Skip to main content

Remote Entity

Derive entity platforms from homeassistant.components.remote.RemoteEntity

Properties

tip

Properties should always only return information from memory and not do I/O (like network requests). Implement update() or async_update() to fetch data.

NameTypeDefaultDescription
current_activitystrNoneReturn the current active activity
activity_listlistNoneReturn the list of available activities

Activity

An activity is a predefined activity or macro that puts the remote in a specific state. For example, a "Watch TV" activity may turn on multiple devices and change the channel to a specific channel.

Supported Features

Supported features are defined by using values in the RemoteEntityFeature enum and are combined using the bitwise or (|) operator.

ValueDescription
LEARN_COMMANDEntity allows learning commands from devices.
DELETE_COMMANDEntity allows deleting commands from devices.
ACTIVITYEntity supports activities.

Methods

Turn On Command

class MyRemote(RemoteEntity):

def turn_on(self, activity: str = None, **kwargs):
"""Send the power on command."""

async def async_turn_on(self, activity: str = None, **kwargs):
"""Send the power on command."""

Turn Off Command

class MyRemote(RemoteEntity):

def turn_off(self, activity: str = None, **kwargs):
"""Send the power off command."""

async def async_turn_off(self, activity: str = None, **kwargs):
"""Send the power off command."""

Toggle Command

class MyRemote(RemoteEntity):

def toggle(self, activity: str = None, **kwargs):
"""Toggle a device."""

async def async_toggle(self, activity: str = None, **kwargs):
"""Toggle a device."""

Send Command

class MyRemote(RemoteEntity):

def send_command(self, command: Iterable[str], **kwargs):
"""Send commands to a device."""

async def async_send_command(self, command: Iterable[str], **kwargs):
"""Send commands to a device."""

Learn Command

Only implement this method if the flag SUPPORT_LEARN_COMMAND is set.

class MyRemote(RemoteEntity):

def learn_command(self, **kwargs):
"""Learn a command from a device."""

async def async_learn_command(self, **kwargs):
"""Learn a command from a device."""

Delete Command

Only implement this method if the flag SUPPORT_DELETE_COMMAND is set.

class MyRemote(RemoteEntity):

def delete_command(self, **kwargs):
"""Delete a command from a device."""

async def async_delete_command(self, **kwargs):
"""Delete a command from a device."""