Skip to content

Commit e4ef473

Browse files
committed
feat: implement sensors
- Also added mspconfig and telemetry type hints to all equipment classes
1 parent 5d0e005 commit e4ef473

12 files changed

Lines changed: 63 additions & 2 deletions

File tree

pyomnilogic_local/backyard.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
class Backyard(OmniEquipment[MSPBackyard, TelemetryBackyard]):
2121
"""Represents the backyard equipment in the OmniLogic system."""
2222

23+
mspconfig: MSPBackyard
24+
telemetry: TelemetryBackyard
2325
bow: EquipmentDict[Bow] = EquipmentDict()
2426
lights: EquipmentDict[ColorLogicLight] = EquipmentDict()
2527
relays: EquipmentDict[Relay] = EquipmentDict()

pyomnilogic_local/bow.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
class Bow(OmniEquipment[MSPBoW, TelemetryBoW]):
2121
"""Represents a bow in the OmniLogic system."""
2222

23+
mspconfig: MSPBoW
24+
telemetry: TelemetryBoW
2325
filters: EquipmentDict[Filter] = EquipmentDict()
2426
heater: Heater | None = None
2527
relays: EquipmentDict[Relay] = EquipmentDict()

pyomnilogic_local/chlorinator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55

66
class Chlorinator(OmniEquipment[MSPChlorinator, TelemetryChlorinator]):
77
"""Represents a chlorinator in the OmniLogic system."""
8+
9+
mspconfig: MSPChlorinator
10+
telemetry: TelemetryChlorinator

pyomnilogic_local/colorlogiclight.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
class ColorLogicLight(OmniEquipment[MSPColorLogicLight, TelemetryColorLogicLight]):
2727
"""Represents a color logic light."""
2828

29+
mspconfig: MSPColorLogicLight
30+
telemetry: TelemetryColorLogicLight
31+
2932
def __init__(self, omni: "OmniLogic", mspconfig: MSPColorLogicLight, telemetry: Telemetry) -> None:
3033
super().__init__(omni, mspconfig, telemetry)
3134

pyomnilogic_local/csad.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55

66
class CSAD(OmniEquipment[MSPCSAD, TelemetryCSAD]):
77
"""Represents a CSAD in the OmniLogic system."""
8+
9+
mspconfig: MSPCSAD
10+
telemetry: TelemetryCSAD

pyomnilogic_local/filter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
class Filter(OmniEquipment[MSPFilter, TelemetryFilter]):
1010
"""Represents a filter in the OmniLogic system."""
1111

12+
mspconfig: MSPFilter
13+
telemetry: TelemetryFilter
14+
1215
# Expose MSPConfig attributes
1316
@property
1417
def equip_type(self) -> str:

pyomnilogic_local/heater.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class Heater(OmniEquipment[MSPVirtualHeater, TelemetryVirtualHeater]):
2222
determine if conversion to Celsius should be performed for display.
2323
"""
2424

25+
mspconfig: MSPVirtualHeater
26+
telemetry: TelemetryVirtualHeater
2527
heater_equipment: EquipmentDict[HeaterEquipment] = EquipmentDict()
2628

2729
def __init__(self, omni: "OmniLogic", mspconfig: MSPVirtualHeater, telemetry: Telemetry) -> None:

pyomnilogic_local/heater_equip.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ class HeaterEquipment(OmniEquipment[MSPHeaterEquip, TelemetryHeater]):
2020
Note: Temperature is always in Fahrenheit internally.
2121
"""
2222

23+
mspconfig: MSPHeaterEquip
24+
telemetry: TelemetryHeater
25+
2326
def __init__(self, omni: "OmniLogic", mspconfig: MSPHeaterEquip, telemetry: Telemetry) -> None:
2427
super().__init__(omni, mspconfig, telemetry)
2528

2629
@property
27-
def heater_type(self) -> HeaterType | str:
30+
def heater_type(self) -> HeaterType:
2831
"""Returns the type of heater (GAS, HEAT_PUMP, SOLAR, etc.)."""
2932
return self.mspconfig.heater_type
3033

pyomnilogic_local/pump.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
class Pump(OmniEquipment[MSPPump, TelemetryPump]):
1010
"""Represents a pump in the OmniLogic system."""
1111

12+
mspconfig: MSPPump
13+
telemetry: TelemetryPump
14+
1215
# Expose MSPConfig attributes
1316
@property
1417
def equip_type(self) -> str:

pyomnilogic_local/relay.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
class Relay(OmniEquipment[MSPRelay, TelemetryRelay]):
1515
"""Represents a relay in the OmniLogic system."""
1616

17+
mspconfig: MSPRelay
18+
telemetry: TelemetryRelay
19+
1720
def __init__(self, omni: "OmniLogic", mspconfig: MSPRelay, telemetry: Telemetry) -> None:
1821
super().__init__(omni, mspconfig, telemetry)
1922

0 commit comments

Comments
 (0)