powersensor_local.plug_api
Interface abstraction for Powersensor plugs.
Classes
|
The primary interface to access the interpreted event stream from a plug. |
- class powersensor_local.plug_api.PlugApi(mac, ip, port=49476, proto='udp')[source]
Bases:
AsyncEventEmitterThe primary interface to access the interpreted event stream from a plug.
The plug may be relaying messages from one or more sensors, in addition to its own reports.
Acts as an AsyncEventEmitter. Events which can be registered for are documented in xlatemsg.translate_raw_message.
- connect()[source]
Initiates a connection to the plug.
Will automatically retry on failure or if the connection is lost, until such a time disconnect() is called.
- property ip_address
Return the IP address provided on construction.
- Returns:
The IP address configured for the listener.
- Return type: