Skip to content

Commit

Permalink
update device samples (#1944)
Browse files Browse the repository at this point in the history
  • Loading branch information
LKuemmel authored Oct 11, 2024
1 parent 5363ed6 commit f76bba6
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion docs/samples/sample_modbus/bat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from dataclass_utils import dataclass_from_dict
from modules.common.abstract_device import AbstractBat
from modules.common.component_state import BatState
from modules.common.component_type import ComponentDescriptor
from modules.common.fault_state import ComponentInfo, FaultState
Expand All @@ -9,7 +10,7 @@
from modules.devices.sample_modbus.config import SampleBatSetup


class SampleBat:
class SampleBat(AbstractBat):
def __init__(self, device_id: int, component_config: SampleBatSetup) -> None:
self.__device_id = device_id
self.component_config = dataclass_from_dict(SampleBatSetup, component_config)
Expand Down
3 changes: 2 additions & 1 deletion docs/samples/sample_modbus/counter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from dataclass_utils import dataclass_from_dict
from modules.common.abstract_device import AbstractCounter
from modules.common.component_state import CounterState
from modules.common.component_type import ComponentDescriptor
from modules.common.fault_state import ComponentInfo, FaultState
Expand All @@ -9,7 +10,7 @@
from modules.devices.sample_modbus.config import SampleCounterSetup


class SampleCounter:
class SampleCounter(AbstractCounter):
def __init__(self, device_id: int, component_config: SampleCounterSetup) -> None:
self.__device_id = device_id
self.component_config = dataclass_from_dict(SampleCounterSetup, component_config)
Expand Down
3 changes: 2 additions & 1 deletion docs/samples/sample_modbus/inverter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from dataclass_utils import dataclass_from_dict
from modules.common.abstract_device import AbstractInverter
from modules.common.component_state import InverterState
from modules.common.component_type import ComponentDescriptor
from modules.common.fault_state import ComponentInfo, FaultState
Expand All @@ -9,7 +10,7 @@
from modules.devices.sample_modbus.config import SampleInverterSetup


class SampleInverter:
class SampleInverter(AbstractInverter):
def __init__(self, device_id: int, component_config: SampleInverterSetup) -> None:
self.__device_id = device_id
self.component_config = dataclass_from_dict(SampleInverterSetup, component_config)
Expand Down
3 changes: 2 additions & 1 deletion docs/samples/sample_request_by_component/bat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
from dataclass_utils import dataclass_from_dict
from modules.common import req
from modules.common.abstract_device import AbstractBat
from modules.common.component_state import BatState
from modules.common.component_type import ComponentDescriptor
from modules.common.fault_state import ComponentInfo, FaultState
Expand All @@ -9,7 +10,7 @@
from modules.devices.sample_request_by_component.config import SampleBatSetup, SampleConfiguration


class SampleBat:
class SampleBat(AbstractBat):
def __init__(self, device_id: int, component_config: SampleBatSetup, ip_address: str) -> None:
self.__device_id = device_id
self.component_config = dataclass_from_dict(SampleBatSetup, component_config)
Expand Down
3 changes: 2 additions & 1 deletion docs/samples/sample_request_by_component/counter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
from dataclass_utils import dataclass_from_dict
from modules.common import req
from modules.common.abstract_device import AbstractCounter
from modules.common.component_state import CounterState
from modules.common.component_type import ComponentDescriptor
from modules.common.fault_state import ComponentInfo, FaultState
Expand All @@ -9,7 +10,7 @@
from modules.devices.sample_request_by_component.config import SampleCounterSetup, SampleConfiguration


class SampleCounter:
class SampleCounter(AbstractCounter):
def __init__(self, device_id: int, component_config: SampleCounterSetup, ip_address: str) -> None:
self.__device_id = device_id
self.component_config = dataclass_from_dict(SampleCounterSetup, component_config)
Expand Down
3 changes: 2 additions & 1 deletion docs/samples/sample_request_by_component/inverter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
from dataclass_utils import dataclass_from_dict
from modules.common import req
from modules.common.abstract_device import AbstractInverter
from modules.common.component_state import InverterState
from modules.common.component_type import ComponentDescriptor
from modules.common.fault_state import ComponentInfo, FaultState
Expand All @@ -9,7 +10,7 @@
from modules.devices.sample_request_by_component.config import SampleInverterSetup, SampleConfiguration


class SampleInverter:
class SampleInverter(AbstractInverter):
def __init__(self, device_id: int, component_config: SampleInverterSetup, ip_address: str) -> None:
self.__device_id = device_id
self.component_config = dataclass_from_dict(SampleInverterSetup, component_config)
Expand Down
3 changes: 2 additions & 1 deletion docs/samples/sample_request_by_device/bat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from dataclass_utils import dataclass_from_dict
from modules.common.abstract_device import AbstractBat
from modules.common.component_state import BatState
from modules.common.component_type import ComponentDescriptor
from modules.common.fault_state import ComponentInfo, FaultState
Expand All @@ -8,7 +9,7 @@
from modules.devices.sample_request_by_device.config import SampleBatSetup


class SampleBat:
class SampleBat(AbstractBat):
def __init__(self, device_id: int, component_config: SampleBatSetup) -> None:
self.__device_id = device_id
self.component_config = dataclass_from_dict(SampleBatSetup, component_config)
Expand Down
3 changes: 2 additions & 1 deletion docs/samples/sample_request_by_device/counter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from dataclass_utils import dataclass_from_dict
from modules.common.abstract_device import AbstractCounter
from modules.common.component_state import CounterState
from modules.common.component_type import ComponentDescriptor
from modules.common.fault_state import ComponentInfo, FaultState
Expand All @@ -8,7 +9,7 @@
from modules.devices.sample_request_by_device.config import SampleCounterSetup


class SampleCounter:
class SampleCounter(AbstractCounter):
def __init__(self, device_id: int, component_config: SampleCounterSetup) -> None:
self.__device_id = device_id
self.component_config = dataclass_from_dict(SampleCounterSetup, component_config)
Expand Down
3 changes: 2 additions & 1 deletion docs/samples/sample_request_by_device/inverter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from dataclass_utils import dataclass_from_dict
from modules.common.abstract_device import AbstractInverter
from modules.common.component_state import InverterState
from modules.common.component_type import ComponentDescriptor
from modules.common.fault_state import ComponentInfo, FaultState
Expand All @@ -8,7 +9,7 @@
from modules.devices.sample_request_by_device.config import SampleInverterSetup


class SampleInverter:
class SampleInverter(AbstractInverter):
def __init__(self, device_id: int, component_config: SampleInverterSetup) -> None:
self.__device_id = device_id
self.component_config = dataclass_from_dict(SampleInverterSetup, component_config)
Expand Down

0 comments on commit f76bba6

Please sign in to comment.