shared.charge_controller_tcp_driver package

Submodules

shared.charge_controller_tcp_driver.charge_controller_tcp_client_cli module

class shared.charge_controller_tcp_driver.charge_controller_tcp_client_cli.CCShell(completekey='tab', stdin=None, stdout=None)

Bases: cmd.Cmd

do_get_c1(arg)

Retrieve the primary contactor’s driving signal state (OPEN/CLOSE) Usage: GET_C1

do_get_c1_real(arg)

Retrieve the primary contactor’s physical state (OPEN/CLOSE) Usage: GET_C1

do_get_c2(arg)

Retrieve the secondary contactor’s state (OPEN/CLOSE) Usage: GET_C2

do_get_ev_state(arg)

Retrieve the current 61851-1 state Usage: GET_EV_STATE

do_get_max_current(arg)

Get the cable’s maximum possible current (either 13, 20, 32 or 63 A) Usage: GET_MAX_CURRENT

do_get_pwm(arg)

Retrieve the currently set PWM Usage: GET_PWM

do_set_c1(arg)

Modify the primary contactor’s position Usage: SET_C1 <OPEN/CLOSE> Example:

SET_C1 OPEN Sets the primary contactor to an open position

do_set_c2(arg)

Modify the secondary contactor’s position Usage: SET_C2 <OPEN/CLOSE> Example:

SET_C2 CLOSE Sets the primary contactor to a closed position

do_set_ev_state(arg)

Modify the current 61851-1 state Usage: SET_EV_STATE <A-D> Example:

SET_EV_STATE A Sets the 61851-1 state to A

do_set_pwm(arg)

Modify the current PWM Usage: SET_PWM <VALUE> Example:

SET_PWM 10 Sets the PWM to 10

intro = "\n _____ ____  _____    ____ ____   ____  _          _ _\n| ____|  _ \\|  ___|  / ___/ ___| / ___|| |__   ___| | |\n|  _| | | | | |_    | |  | |     \\___ \\| '_ \\ / _ \\ | |\n| |___| |_| |  _|   | |__| |___   ___) | | | |  __/ | |\n|_____|____/|_|      \\____\\____| |____/|_| |_|\\___|_|_|\n\nWelcome to the Charge Controller TCP client shell. Type help or ? to list commands.\n"
precmd(line)

Hook method executed just before the command line is interpreted, but after the input prompt is generated and issued.

prompt = '(Charge Controller) '
shared.charge_controller_tcp_driver.charge_controller_tcp_client_cli.check_valid_state(arg)
shared.charge_controller_tcp_driver.charge_controller_tcp_client_cli.parse(arg, t: type = <class 'str'>)

Convert a series of zero or more arguments to a tuple

shared.charge_controller_tcp_driver.charge_controller_tcp_client_cli.print_results() None

shared.charge_controller_tcp_driver.charge_controller_tcp_client_helper module

class shared.charge_controller_tcp_driver.charge_controller_tcp_client_helper.ChargeControllerTCPClientHelper(ip_address, port)

Bases: object

connect()
disconnect()
get_c1()
get_c1_real()
get_c2()
get_command()
get_ev_state()
get_max_current()
get_pwm()
get_status()
get_value()
is_ok()
send_message(msg: str) None

Send a message over the TCP socket, and display the response :param msg: The message to send

set_c1(v: str)
set_c2(v: str)
set_ev_state(v: str)
set_pwm(v: int)

shared.charge_controller_tcp_driver.exemple_driver module

Module contents