switch

class platypush.plugins.switch.SwitchPlugin(**kwargs)[source]

Abstract class for interacting with switch devices

__init__(**kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

off(device, *args, **kwargs)[source]

Turn the device off

on(device, *args, **kwargs)[source]

Turn the device on

status(device=None, *args, **kwargs)Union[dict, List[dict]][source]

Get the status of all the devices, or filter by device name or ID (alias for switch_status()).

Parameters

device – Filter by device name or ID.

Returns

[
  {
    "id": "Device unique ID",
    "name": "Device name",
    "on": "True if the device is on, False otherwise"
  }
]

switch_status(device=None)Union[dict, List[dict]][source]

Get the status of a specified device or of all the configured devices (default).

Parameters

device – Filter by device name or ID.

Returns

[
  {
    "id": "Device unique ID",
    "name": "Device name",
    "on": "True if the device is on, False otherwise"
  }
]

property switches
Returns

[
  {
    "id": "Device unique ID",
    "name": "Device name",
    "on": "True if the device is on, False otherwise"
  }
]

toggle(device, *args, **kwargs)[source]

Toggle the device status (on/off)