2023-12-09 17:57:37 +00:00
|
|
|
# -*- 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}")
|
2023-12-10 22:55:26 +00:00
|
|
|
|
|
|
|
# print(f"Name: {cc.name}")
|
|
|
|
# cc.name = "☀️ 🔌🔋Charger"
|
|
|
|
# print(f"Name: {cc.name}")
|