powersensor_local.devices

Abstraction interface for unified event stream from Powersensor devices.

Classes

PowersensorDevices

PowersensorLegacyDevices([bcast_addr, ...])

Abstraction interface for the unified event stream from all Powersensor devices on the local network, using the legacy broadcast UDP discovery.

powersensor_local.devices.PowersensorDevices

alias of PowersensorLegacyDevices

class powersensor_local.devices.PowersensorLegacyDevices(bcast_addr='<broadcast>', relay_now_relaying_for=False, logger=None)[source]

Bases: _PowersensorDevicesBase

Abstraction interface for the unified event stream from all Powersensor devices on the local network, using the legacy broadcast UDP discovery.

This is the original PowersensorDevices implementation, renamed to make room for PowersensorZeroconfDevices. The name PowersensorDevices is kept as an alias for backwards compatibility.

async rescan()[source]

Perform a fresh scan to discover added or moved devices.

Return type:

None

async start(async_event_cb)[source]

Register the async event callback and scan the local network.

The callback has the form:

async def yourcallback(event: dict) -> None

See _PowersensorDevicesBase for the full list of known events.

Additionally emits:

Return type:

int

scan_complete

Indicates discovery has completed. { event: "scan_complete", gateway_count: N }

Returns the number of gateway plugs found.