Make consumer aware of the charge controller
This commit is contained in:
parent
fe9c6a82ff
commit
71919fc406
2 changed files with 8 additions and 0 deletions
|
@ -33,6 +33,11 @@ def main():
|
|||
log("Connected.")
|
||||
|
||||
cc = ChargeController(dev)
|
||||
log(f"Controller model: {cc.model}")
|
||||
log(f"Controller version: {cc.version}")
|
||||
log(f"Controller serial: {cc.serial}")
|
||||
for consumer in consumers:
|
||||
consumer.controller = cc
|
||||
|
||||
# write(dev, construct_request(0, 32))
|
||||
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
from abc import ABC, abstractmethod
|
||||
from typing import Any, Dict
|
||||
|
||||
from ..protocol import ChargeController
|
||||
|
||||
|
||||
class BaseConsumer(ABC):
|
||||
settings: Dict[str, Any]
|
||||
controller: ChargeController | None = None
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self, settings: Dict[str, Any]) -> None:
|
||||
|
|
Loading…
Reference in a new issue