23 lines
623 B
Python
23 lines
623 B
Python
|
# -*- coding: utf-8 -*-
|
||
|
import os
|
||
|
import sys
|
||
|
from time import sleep
|
||
|
|
||
|
sys.path.insert(1, os.path.dirname(os.path.dirname(sys.argv[0])))
|
||
|
|
||
|
from srnemqtt.config import get_config, get_interface # noqa: E402
|
||
|
from srnemqtt.protocol import ChargeController # noqa: E402
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
conf = get_config()
|
||
|
iface = get_interface(conf)
|
||
|
cc = ChargeController(iface)
|
||
|
|
||
|
print(f"Serial: {cc.serial}")
|
||
|
print(f"Load enabled: {cc.load_enabled}")
|
||
|
cc.load_enabled = True
|
||
|
print(f"Load enabled: {cc.load_enabled}")
|
||
|
sleep(5)
|
||
|
cc.load_enabled = False
|
||
|
print(f"Load enabled: {cc.load_enabled}")
|