Prime Charger 160w

class SolixBLE.PrimeCharger160w(ble_device: BLEDevice)

Anker Prime Charger (160w) model.

Use this class to connect and monitor the 160w charger. This model is also known as the A2687.

__init__(ble_device: BLEDevice) None

Initialise device object. Does not connect automatically.

add_callback(function: Callable[[], None]) None

Register a callback to be run on state updates.

Triggers include changes to pretty much anything, including, battery percentage, output power, solar, connection status, etc.

Parameters:

function – Function to run on state changes.

async connect(max_attempts: int = 3, run_callbacks: bool = True) bool

Connect to device.

This will connect to the device, determine if it is supported and subscribe to status updates, returning True if successful.

Parameters:
  • max_attempts – Maximum number of attempts to try to connect (default=3).

  • run_callbacks – Execute registered callbacks on successful connection (default=True).

async disconnect() None

Disconnect from device and reset internal state.

Disconnects from device, resets internal state, including connection attempts, cancels the automatic reconnection task and will not execute state changes callbacks.

remove_callback(function: Callable[[], None]) None

Remove a registered state change callback.

Parameters:

function – Function to remove from callbacks.

Raises:

ValueError – If callback does not exist.

async set_timer_usb_c1(time: int) None

Set auto off timer for USB C1.

Parameters:

time – Seconds until shutdown.

Raises:
  • ConnectionError – If not connected to device.

  • BleakError – If command transmission fails.

async set_timer_usb_c2(time: int) None

Set auto off timer for USB C2.

Parameters:

time – Seconds until shutdown.

Raises:
  • ConnectionError – If not connected to device.

  • BleakError – If command transmission fails.

async set_timer_usb_c3(time: int) None

Set auto off timer for USB C3.

Parameters:

time – Seconds until shutdown.

Raises:
  • ConnectionError – If not connected to device.

  • BleakError – If command transmission fails.

async turn_usb_c1_off() None

Turn USB port C1 off.

Raises:
  • ConnectionError – If not connected to device.

  • BleakError – If command transmission fails.

async turn_usb_c1_on() None

Turn USB port C1 on.

Raises:
  • ConnectionError – If not connected to device.

  • BleakError – If command transmission fails.

async turn_usb_c2_off() None

Turn USB port C2 off.

Raises:
  • ConnectionError – If not connected to device.

  • BleakError – If command transmission fails.

async turn_usb_c2_on() None

Turn USB port C2 on.

Raises:
  • ConnectionError – If not connected to device.

  • BleakError – If command transmission fails.

async turn_usb_c3_off() None

Turn USB port C3 off.

Raises:
  • ConnectionError – If not connected to device.

  • BleakError – If command transmission fails.

async turn_usb_c3_on() None

Turn USB port C3 on.

Raises:
  • ConnectionError – If not connected to device.

  • BleakError – If command transmission fails.

property address: str

MAC address of device.

Returns:

The Bluetooth MAC address of the device.

property available: bool

Connected to device and data is available.

Returns:

True/False if the device is connected and sending telemetry.

property connected: bool

Connected to device.

This does not mean that an encrypted connection has been established or that any data values have been populated, use the available property to determine that.

Returns:

True/False if connected to device.

property last_update: datetime | None

Timestamp of last telemetry data update from device.

Returns:

Timestamp of last update or None.

property name: str

Bluetooth name of the device.

Returns:

The name of the device or default string value.

property negotiated: bool

Has an encrypted session been successfully negotiated.

This does not mean that any data values have been populated, use the available property to determine that.

Returns:

True/False if session has been negotiated and connected.

property usb_c1_current: float

USB C1 Port current (A).

Returns:

Current of the USB C1 port or default float value.

property usb_c1_power: float

USB C1 Port power (W).

Returns:

Power of the USB C1 port or default float value.

property usb_c1_voltage: float

USB C1 Port voltage (V).

Returns:

Voltage of the USB C1 port or default float value.

property usb_c2_current: float

USB C2 Port current (A).

Returns:

Current of the USB C2 port or default float value.

property usb_c2_power: float

USB C2 Port power (W).

Returns:

Power of the USB C2 port or default float value.

property usb_c2_voltage: float

USB C2 Port voltage (V).

Returns:

Voltage of the USB C2 port or default float value.

property usb_c3_current: float

USB C3 Port current (A).

Returns:

Current of the USB C3 port or default float value.

property usb_c3_power: float

USB C3 Port power (W).

Returns:

Power of the USB C3 port or default float value.

property usb_c3_voltage: float

USB C3 Port voltage (V).

Returns:

Voltage of the USB C3 port or default float value.

property usb_port_c1: PortStatus

USB C1 Port Status.

Returns:

Status of the USB C1 port.

property usb_port_c2: PortStatus

USB C2 Port Status.

Returns:

Status of the USB C2 port.

property usb_port_c3: PortStatus

USB C3 Port Status.

Returns:

Status of the USB C3 port.