Signal
homey.signal
Base class for signals.
Ancestors
- SimpleClass
- homey.util.event_emitter.EventEmitter
- typing.Generic
- abc.ABC
Subclasses
Methods
cmd
async def cmd(self,command_id: str,
repetitions: int | None = None,
device: Device | None = None) ‑> None
Send a predefined command using this signal.
Requires the homey:wireless:433, homey:wireless:868, or homey:wireless:ir permissions.
For more information about permissions read the Permissions tutorial.
Args
| Name | Type | Description |
|---|---|---|
command_id |
str | The ID of the command, as defined in app.json. |
repetitions |
int | None | How often the signal gets transmitted. |
device |
Device | None | The Device to send the signal to. |
tx
async def tx(self,frame: list[int] | bytes | bytearray,
repetitions: int | None = None,
device: Device | None = None) ‑> None
Transmit a raw frame using this signal.
Args
| Name | Type | Description |
|---|---|---|
frame |
list[int] | bytes | bytearray | The data to be transmitted. |
repetitions |
int | None | How often the signal gets transmitted. |
device |
Device | None | The Device to send the signal to. |
disable_rx
async def disable_rx(self) ‑> NoneDisable receiving commands for this signal.
Requires the homey:wireless:433, homey:wireless:868, or homey:wireless:ir permissions.
For more information about permissions read the Permissions tutorial.
enable_rx
async def enable_rx(self) ‑> NoneEnable receiving commands for this signal.
Requires the homey:wireless:433, homey:wireless:868, or homey:wireless:ir permissions.
For more information about permissions read the Permissions tutorial.
on_payload
def on_payload(self, f: Callable[[tuple[int, ...], bool], None]) ‑> SelfThis event is fired when a signal payload has been received.
Args
| Name | Type | Description |
|---|---|---|
f |
Callable[[tuple[int, ...], bool], None] | A callback that receives an array of word indices, as well as whether this is the first detected repetition of the signal. |