switch.wemo
Platypush documentation
switch.wemo
- class platypush.plugins.switch.wemo.SwitchWemoPlugin(devices=None, netmask: Optional[str] = None, port: int = 49153, **kwargs)[source]
Bases:
SwitchPlugin
Plugin to control a Belkin WeMo smart switches (https://www.belkin.com/us/Products/home-automation/c/wemo-home-automation/)
- __init__(devices=None, netmask: Optional[str] = None, port: int = 49153, **kwargs)[source]
- Parameters:
devices (list or dict) – List of IP addresses or name->address map containing the WeMo Switch devices to control. This plugin previously used ouimeaux for auto-discovery but it’s been dropped because 1. too slow 2. too heavy 3. auto-discovery failed too often.
netmask – Alternatively to a list of static IP->name pairs, you can specify the network mask where the devices should be scanned (e.g. ‘192.168.1.0/24’)
port – Port where the WeMo devices are expected to expose the RPC/XML over HTTP service (default: 49153)
- get_name(device: str)[source]
Get the friendly name of a device
- Parameters:
device – Device name or address
- get_state(device: str)[source]
Get the on state of a device (True/False)
- Parameters:
device – Device name or address
- status(device: str = None, *args, **kwargs)[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" } ]