|
| 1 | +#!/usr/bin/env python3 |
| 2 | +from typing import Optional |
| 3 | + |
| 4 | +from modules.common.component_setup import ComponentSetup |
| 5 | +from ..vendor import vendor_descriptor |
| 6 | + |
| 7 | + |
| 8 | +class KacoNHConfiguration: |
| 9 | + def __init__(self, ip_address: Optional[str] = None, |
| 10 | + port: Optional[int] = None, |
| 11 | + serial_number: Optional[str] = None): |
| 12 | + self.ip_address = ip_address |
| 13 | + self.port = port |
| 14 | + self.serial_number = serial_number |
| 15 | + |
| 16 | + |
| 17 | +class KacoNH: |
| 18 | + def __init__(self, |
| 19 | + name: str = "Kaco NH", |
| 20 | + type: str = "kaco_nh", |
| 21 | + id: int = 0, |
| 22 | + configuration: KacoNHConfiguration = None) -> None: |
| 23 | + self.name = name |
| 24 | + self.type = type |
| 25 | + self.vendor = vendor_descriptor.configuration_factory().type |
| 26 | + self.id = id |
| 27 | + self.configuration = configuration or KacoNHConfiguration() |
| 28 | + |
| 29 | + |
| 30 | +class KacoNHBatConfiguration: |
| 31 | + def __init__(self, id: int = 0): |
| 32 | + self.id = id |
| 33 | + |
| 34 | + |
| 35 | +class KacoNHBatSetup(ComponentSetup[KacoNHBatConfiguration]): |
| 36 | + def __init__(self, |
| 37 | + name: str = "Kaco NH Speicher", |
| 38 | + type: str = "bat", |
| 39 | + id: int = 0, |
| 40 | + configuration: KacoNHBatConfiguration = None) -> None: |
| 41 | + super().__init__(name, type, id, configuration or KacoNHBatConfiguration()) |
| 42 | + |
| 43 | + |
| 44 | +class KacoNHCounterConfiguration: |
| 45 | + def __init__(self, id: int = 0): |
| 46 | + self.id = id |
| 47 | + |
| 48 | + |
| 49 | +class KacoNHCounterSetup(ComponentSetup[KacoNHCounterConfiguration]): |
| 50 | + def __init__(self, |
| 51 | + name: str = "Kaco NH Zähler", |
| 52 | + type: str = "counter", |
| 53 | + id: int = 0, |
| 54 | + configuration: KacoNHCounterConfiguration = None) -> None: |
| 55 | + super().__init__(name, type, id, configuration or KacoNHCounterConfiguration()) |
| 56 | + |
| 57 | + |
| 58 | +class KacoNHInverterConfiguration: |
| 59 | + def __init__(self, id: int = 0): |
| 60 | + self.id = id |
| 61 | + |
| 62 | + |
| 63 | +class KacoNHInverterSetup(ComponentSetup[KacoNHInverterConfiguration]): |
| 64 | + def __init__(self, |
| 65 | + name: str = "KacoNH Wechselrichter", |
| 66 | + type: str = "inverter", |
| 67 | + id: int = 0, |
| 68 | + configuration: KacoNHInverterConfiguration = None) -> None: |
| 69 | + super().__init__(name, type, id, configuration or KacoNHInverterConfiguration()) |
0 commit comments