|
| 1 | +"""CSAD equipment classes for Omnilogic.""" |
| 2 | + |
| 3 | +from typing import TYPE_CHECKING, Literal |
| 4 | + |
| 5 | +from pyomnilogic_local._base import OmniEquipment |
| 6 | +from pyomnilogic_local.models.mspconfig import MSPCSADEquip |
| 7 | +from pyomnilogic_local.models.telemetry import Telemetry |
| 8 | +from pyomnilogic_local.omnitypes import CSADEquipmentType |
| 9 | + |
| 10 | +if TYPE_CHECKING: |
| 11 | + from pyomnilogic_local.omnilogic import OmniLogic |
| 12 | + |
| 13 | + |
| 14 | +class CSADEquipment(OmniEquipment[MSPCSADEquip, None]): |
| 15 | + """Represents a CSAD (chemical automation) equipment device. |
| 16 | +
|
| 17 | + CSADEquipment represents an individual physical CSAD device (e.g., AQL-CHEM). |
| 18 | + It is controlled by a parent CSAD which manages one or more physical CSAD units. |
| 19 | +
|
| 20 | + The OmniLogic system uses a parent/child CSAD architecture: |
| 21 | + - CSAD: User-facing CSAD control (monitoring, dispensing) |
| 22 | + - CSADEquipment: Individual physical CSAD devices managed by the parent |
| 23 | +
|
| 24 | + CSAD Equipment Types: |
| 25 | + - AQL_CHEM: AquaLink Chemistry System |
| 26 | +
|
| 27 | + Note: Like chlorinator equipment, CSAD equipment does not have separate |
| 28 | + telemetry entries. All telemetry is reported through the parent CSAD. |
| 29 | +
|
| 30 | + Attributes: |
| 31 | + mspconfig: Configuration data for this physical CSAD equipment |
| 32 | +
|
| 33 | + Properties (Configuration): |
| 34 | + equip_type: Equipment type (always "PET_CSAD") |
| 35 | + csad_type: Type of CSAD equipment (e.g., AQL_CHEM) |
| 36 | + enabled: Whether this CSAD equipment is enabled |
| 37 | +
|
| 38 | + Example: |
| 39 | + >>> pool = omni.backyard.bow["Pool"] |
| 40 | + >>> csad = pool.get_csad() |
| 41 | + >>> |
| 42 | + >>> # Access physical CSAD equipment |
| 43 | + >>> for equip in csad.csad_equipment: |
| 44 | + ... print(f"CSAD Equipment: {equip.name}") |
| 45 | + ... print(f"Type: {equip.csad_type}") |
| 46 | + ... print(f"Enabled: {equip.enabled}") |
| 47 | + ... print(f"System ID: {equip.system_id}") |
| 48 | +
|
| 49 | + Important Notes: |
| 50 | + - CSADEquipment is read-only (no direct control methods) |
| 51 | + - Control CSAD equipment through the parent CSAD instance |
| 52 | + - Telemetry is accessed through the parent CSAD, not individual equipment |
| 53 | + - Equipment may be disabled but still configured in the system |
| 54 | + """ |
| 55 | + |
| 56 | + mspconfig: MSPCSADEquip |
| 57 | + telemetry: None |
| 58 | + |
| 59 | + def __init__(self, omni: "OmniLogic", mspconfig: MSPCSADEquip, telemetry: Telemetry | None) -> None: |
| 60 | + super().__init__(omni, mspconfig, telemetry) |
| 61 | + |
| 62 | + @property |
| 63 | + def equip_type(self) -> Literal["PET_CSAD"]: |
| 64 | + """Returns the equipment type (always 'PET_CSAD').""" |
| 65 | + return self.mspconfig.equip_type |
| 66 | + |
| 67 | + @property |
| 68 | + def csad_type(self) -> CSADEquipmentType | str: |
| 69 | + """Returns the type of CSAD equipment (e.g., AQL_CHEM).""" |
| 70 | + return self.mspconfig.csad_type |
| 71 | + |
| 72 | + @property |
| 73 | + def enabled(self) -> bool: |
| 74 | + """Returns whether the CSAD equipment is enabled in configuration.""" |
| 75 | + return self.mspconfig.enabled |
0 commit comments