|
21 | 21 |
|
22 | 22 |
|
23 | 23 | class Bow(OmniEquipment[MSPBoW, TelemetryBoW]): |
24 | | - """Represents a bow in the OmniLogic system.""" |
| 24 | + """Represents a Body of Water (BoW) - pool or spa - in the OmniLogic system. |
| 25 | +
|
| 26 | + A Body of Water (commonly abbreviated as BoW) is a pool or spa, along with |
| 27 | + all of its associated equipment. Each BoW contains: |
| 28 | + - Filtration pumps |
| 29 | + - Heating equipment |
| 30 | + - Chlorination/sanitization systems |
| 31 | + - Chemistry monitoring (CSAD) |
| 32 | + - Lighting |
| 33 | + - Auxiliary pumps (water features, etc.) |
| 34 | + - Relays (jets, blowers, etc.) |
| 35 | + - Sensors (water temperature, flow, etc.) |
| 36 | +
|
| 37 | + The Bow class provides access to all equipment associated with a specific |
| 38 | + pool or spa, as well as water temperature monitoring and spillover control |
| 39 | + for pool/spa combination systems. |
| 40 | +
|
| 41 | + Attributes: |
| 42 | + mspconfig: Configuration data for this body of water |
| 43 | + telemetry: Real-time operational data |
| 44 | + filters: Collection of filtration pumps |
| 45 | + heater: Virtual heater (if configured) |
| 46 | + relays: Collection of relays (jets, blowers, aux equipment) |
| 47 | + sensors: Collection of sensors (water temp, flow, etc.) |
| 48 | + lights: Collection of ColorLogic lights |
| 49 | + pumps: Collection of pumps (water features, etc.) |
| 50 | + chlorinator: Chlorinator system (if configured) |
| 51 | + csads: Collection of CSAD (chemistry) systems |
| 52 | +
|
| 53 | + Properties (Configuration): |
| 54 | + equip_type: Body of water type (BOW_POOL or BOW_SPA) |
| 55 | + supports_spillover: Whether spillover is available |
| 56 | +
|
| 57 | + Properties (Telemetry): |
| 58 | + water_temp: Current water temperature (Fahrenheit) |
| 59 | + flow: True if flow is detected, False otherwise |
| 60 | +
|
| 61 | + Control Methods: |
| 62 | + set_spillover(speed): Set spillover pump speed (0-100%) |
| 63 | + turn_on_spillover(): Turn on spillover at maximum speed |
| 64 | + turn_off_spillover(): Turn off spillover |
| 65 | +
|
| 66 | + Example: |
| 67 | + >>> omni = OmniLogic("192.168.1.100") |
| 68 | + >>> await omni.refresh() |
| 69 | + >>> |
| 70 | + >>> # Access pool |
| 71 | + >>> pool = omni.backyard.bow["Pool"] |
| 72 | + >>> print(f"Water temp: {pool.water_temp}°F") |
| 73 | + >>> print(f"Flow detected: {pool.flow > 0}") |
| 74 | + >>> |
| 75 | + >>> # Access pool equipment |
| 76 | + >>> if pool.heater: |
| 77 | + ... await pool.heater.set_temperature(85) |
| 78 | + >>> |
| 79 | + >>> if pool.chlorinator: |
| 80 | + ... print(f"Salt level: {pool.chlorinator.avg_salt_level} ppm") |
| 81 | + >>> |
| 82 | + >>> for filter in pool.filters: |
| 83 | + ... print(f"Filter: {filter.name}, Speed: {filter.speed}%") |
| 84 | + >>> |
| 85 | + >>> for light in pool.lights: |
| 86 | + ... await light.set_show(ColorLogicShow25.TROPICAL) |
| 87 | + >>> |
| 88 | + >>> # Spillover control (pool/spa combo systems) |
| 89 | + >>> if pool.supports_spillover: |
| 90 | + ... await pool.turn_on_spillover() |
| 91 | + ... await pool.set_spillover(75) # 75% speed |
| 92 | + ... await pool.turn_off_spillover() |
| 93 | +
|
| 94 | + Pool vs Spa: |
| 95 | + Bodies of water can be either pools or spas, distinguished by the |
| 96 | + equip_type property: |
| 97 | +
|
| 98 | + >>> if pool.equip_type == BodyOfWaterType.POOL: |
| 99 | + ... print("This is a pool") |
| 100 | + >>> elif pool.equip_type == BodyOfWaterType.SPA: |
| 101 | + ... print("This is a spa") |
| 102 | +
|
| 103 | + Spillover Systems: |
| 104 | + Some installations have combined pool/spa systems with spillover |
| 105 | + capability that allows water to flow from spa to pool or vice versa: |
| 106 | +
|
| 107 | + - supports_spillover indicates if the feature is available |
| 108 | + - Spillover is controlled by a dedicated pump |
| 109 | + - Speed range is 0-100% (0 turns spillover off) |
| 110 | + - Convenience methods simplify on/off operations |
| 111 | +
|
| 112 | + Equipment Collections: |
| 113 | + Equipment is stored in EquipmentDict collections which allow access by: |
| 114 | + - Name (string): pool.filters["Main Filter"] |
| 115 | + - System ID (int): pool.filters[123] |
| 116 | + - Index (int): pool.filters[0] |
| 117 | + - Iteration: for filter in pool.filters: ... |
| 118 | +
|
| 119 | + Note: |
| 120 | + - Water temperature returns -1 if sensor not available |
| 121 | + - Flow telemetry typically reads 255 or 1 for flow, 0 for no flow, we simplify to bool |
| 122 | + - Not all bodies of water have all equipment types |
| 123 | + - Some equipment (heater, chlorinator) may be None if not configured |
| 124 | + - Spillover operations raise ValueError if not supported |
| 125 | + """ |
25 | 126 |
|
26 | 127 | mspconfig: MSPBoW |
27 | 128 | telemetry: TelemetryBoW |
@@ -56,13 +157,17 @@ def water_temp(self) -> int: |
56 | 157 | return self.telemetry.water_temp |
57 | 158 |
|
58 | 159 | @property |
59 | | - def flow(self) -> int: |
| 160 | + def flow(self) -> bool: |
60 | 161 | """Current flow sensor reading. |
61 | 162 |
|
62 | 163 | Returns: |
63 | | - Flow value (255 typically indicates flow present, 0 indicates no flow) |
| 164 | + bool: True if flow is present, False otherwise. |
64 | 165 | """ |
65 | | - return self.telemetry.flow |
| 166 | + # Flow values: |
| 167 | + # 255 seems to indicate "assumed flow", for example, because a filter pump is on |
| 168 | + # 1 seems to indicate "certain flow", for example, when there is an actual flow sensor |
| 169 | + # 0 indicates no flow |
| 170 | + return self.telemetry.flow > 0 |
66 | 171 |
|
67 | 172 | # Control methods |
68 | 173 | @dirties_state() |
|
0 commit comments