plestylib.solver.iceblock#

Classes#

ICEBLOCKSolver

Operation solver for the ICEBLOCK JSON message protocol.

Module Contents#

class plestylib.solver.iceblock.ICEBLOCKSolver#

Bases: plestylib.solver.OpSolver

Operation solver for the ICEBLOCK JSON message protocol.

The solver builds compact JSON messages with an auto-incrementing transmission_id token and provides helpers to decode responses and evaluate success status.

tk = 1#
_build_msg(op, parameters=None)#

Build a protocol message and serialize it as compact JSON.

Parameters:
  • op – Operation name sent to the remote device.

  • parameters – Optional operation parameters dictionary.

Returns:

{"message": {"transmission_id": [id], "op": op, ...}}

Return type:

JSON string in the shape

Create the start_link command payload.

Parameters:

ip_address – Remote ICEBLOCK endpoint address.

Returns:

Serialized JSON command for start_link.

decode_response(response)#

Decode a JSON response and return its message object.

Parameters:

response – Raw response text from the device.

Returns:

The decoded message dictionary when parsing succeeds, otherwise None after error handling.

status_ok(response)#

Check whether a response contains parameters.status == 'ok'.

Parameters:

response – Either a decoded response dictionary or raw JSON text.

Returns:

True when status is ok; otherwise False.