How joyfulhouse/pylxpweb works
pylxpweb is an async Python client for monitoring and controlling Luxpower/EG4 solar equipment. Its main workflow is to connect through a selected cloud or local transport, load a station and its device hierarchy, refresh device data, and expose scaled runtime and energy properties. A lower-level API also supports endpoint operations and inverter controls. The README documents firmware updates, regional cloud access, and several transport modes; source excerpts and the SOURCE INDEX show only some internal wiring, so unsampled relationships are omitted or marked unverified.
Main entry points: factory.py Transport factory · data.py Transport data · station.py Station hierarchy · base.py Inverter devices
Components 22
Client and API
- Async client
src/pylxpweb/client.py - API namespace
src/pylxpweb/api_namespace.py - Cloud endpoints
src/pylxpweb/endpoints - Control operations
src/pylxpweb/endpoints/control.py
Device model
- Station hierarchy
src/pylxpweb/devices/station.py - Inverter devices
src/pylxpweb/devices/inverters/base.py - Device properties
src/pylxpweb/devices/base.py - Battery models
src/pylxpweb/devices/battery.py - Firmware updates
src/pylxpweb/devices/_firmware_update_mixin.py
Transports
- Transport factory
src/pylxpweb/transports/factory.py - Cloud HTTP
src/pylxpweb/transports/http.py - WiFi dongle
src/pylxpweb/transports/dongle.py - Modbus links
src/pylxpweb/transports/modbus.py - Hybrid fallback
src/pylxpweb/transports/hybrid.py
Data and registers
- Transport data
src/pylxpweb/transports/data.py - Canonical registers
src/pylxpweb/registers/inverter_input.py - Register mappings
src/pylxpweb/constants/registers.py - Value scaling
src/pylxpweb/constants/scaling.py - Validated models
src/pylxpweb/models.py
Other components
- Python application
- Inverter or dongle
- Regional cloud API
Connections 25
- Python application → Async client: creates client
- Python application → Station hierarchy: loads station
- Async client → API namespace: exposes
src/pylxpweb/client.py - API namespace → Cloud endpoints: provides endpoints
src/pylxpweb/api_namespace.py - Async client → Cloud endpoints: calls
src/pylxpweb/client.py - Python application → Control operations: sets parameters
- Station hierarchy → Inverter devices: builds hierarchy
src/pylxpweb/devices/station.py - Station hierarchy → Battery models: builds hierarchy
src/pylxpweb/devices/station.py - Inverter devices → Device properties: inherits properties
src/pylxpweb/devices/inverters/base.py - Inverter devices → Firmware updates: uses update mixin
src/pylxpweb/devices/inverters/base.py - Station hierarchy → Async client: loads through
- Python application → Transport factory: selects transport
- Transport factory → Cloud HTTP: creates
- Transport factory → WiFi dongle: creates
src/pylxpweb/transports/__init__.py - Transport factory → Modbus links: creates
src/pylxpweb/transports/__init__.py - Transport factory → Hybrid fallback: creates
src/pylxpweb/transports/__init__.py - Cloud HTTP → Regional cloud API: sends requests
- WiFi dongle → Inverter or dongle: reads locally
- Modbus links → Inverter or dongle: reads registers
- Hybrid fallback → Regional cloud API: falls back
- Inverter devices → Transport data: reads transport data
src/pylxpweb/devices/inverters/base.py - Transport data → Canonical registers: decodes registers
src/pylxpweb/transports/data.py - Transport data → Register mappings: uses mappings
src/pylxpweb/transports/data.py - Transport data → Value scaling: scales values
src/pylxpweb/transports/data.py - Transport data → Validated models: builds data models
src/pylxpweb/transports/data.py