python-omnilogic-local 0.5.1__py3-none-any.whl → 0.6.1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,10 @@
1
+ class OmniLogicException(Exception):
2
+ pass
3
+
4
+
5
+ class OmniTimeoutException(OmniLogicException):
6
+ pass
7
+
8
+
9
+ class OmniParsingException(OmniLogicException):
10
+ pass
@@ -4,20 +4,19 @@ import logging
4
4
  import sys
5
5
  from typing import Any, Literal, TypeAlias
6
6
 
7
- from ..types import OmniParsingException
8
-
9
7
  if sys.version_info >= (3, 11):
10
8
  from typing import Self
11
9
  else:
12
10
  from typing_extensions import Self
13
11
 
14
-
15
12
  from pydantic import BaseModel, Field, ValidationError
16
13
  from xmltodict import parse as xml_parse
17
14
 
15
+ from ..exceptions import OmniParsingException
18
16
  from ..types import (
19
17
  BodyOfWaterType,
20
18
  ColorLogicLightType,
19
+ ColorLogicShow,
21
20
  FilterType,
22
21
  HeaterType,
23
22
  OmniType,
@@ -143,6 +142,11 @@ class MSPColorLogicLight(OmniBase):
143
142
  omni_type: OmniType = OmniType.CL_LIGHT
144
143
  type: ColorLogicLightType | str = Field(alias="Type")
145
144
  v2_active: Literal["yes", "no"] | None = Field(alias="V2-Active")
145
+ effects: list[ColorLogicShow] | None
146
+
147
+ def __init__(self, **data: Any) -> None:
148
+ super().__init__(**data)
149
+ self.effects = list(ColorLogicShow) if self.v2_active == "yes" else [show for show in ColorLogicShow if show.value <= 16]
146
150
 
147
151
 
148
152
  class MSPBoW(OmniBase):
@@ -5,6 +5,7 @@ from typing import Any, SupportsInt, TypeAlias, TypeVar, cast, overload
5
5
  from pydantic import BaseModel, Field, ValidationError
6
6
  from xmltodict import parse as xml_parse
7
7
 
8
+ from ..exceptions import OmniParsingException
8
9
  from ..types import (
9
10
  BackyardState,
10
11
  ChlorinatorOperatingMode,
@@ -17,7 +18,6 @@ from ..types import (
17
18
  FilterWhyOn,
18
19
  HeaterMode,
19
20
  HeaterState,
20
- OmniParsingException,
21
21
  OmniType,
22
22
  PumpState,
23
23
  RelayState,
@@ -47,8 +47,9 @@ class TelemetryBackyard(BaseModel):
47
47
  status_version: int = Field(alias="@statusVersion")
48
48
  air_temp: int = Field(alias="@airTemp")
49
49
  state: BackyardState | int = Field(alias="@state")
50
- config_checksum: int = Field(alias="@ConfigChksum")
51
- msp_version: str = Field(alias="@mspVersion")
50
+ # The below two fields are only available for telemetry with a status_version >= 11
51
+ config_checksum: int | None = Field(alias="@ConfigChksum")
52
+ msp_version: str | None = Field(alias="@mspVersion")
52
53
 
53
54
 
54
55
  class TelemetryBoW(BaseModel):
@@ -115,7 +116,7 @@ class TelemetryPump(BaseModel):
115
116
  omni_type: OmniType = OmniType.PUMP
116
117
  system_id: int = Field(alias="@systemId")
117
118
  state: PumpState | int = Field(alias="@pumpState")
118
- speed: int = Field(alias="@pummpSpeed")
119
+ speed: int = Field(alias="@pumpSpeed")
119
120
  last_speed: int = Field(alias="@lastSpeed")
120
121
  why_on: int = Field(alias="@whyOn")
121
122
 
@@ -172,7 +173,7 @@ class Telemetry(BaseModel):
172
173
  pump: list[TelemetryPump] | None = Field(alias="Pump")
173
174
  relay: list[TelemetryRelay] | None = Field(alias="Relay")
174
175
  valve_actuator: list[TelemetryValveActuator] | None = Field(alias="ValveActuator")
175
- virtual_heater: TelemetryVirtualHeater | None = Field(alias="VirtualHeater")
176
+ virtual_heater: list[TelemetryVirtualHeater] | None = Field(alias="VirtualHeater")
176
177
 
177
178
  class Config:
178
179
  orm_mode = True
@@ -225,6 +226,7 @@ class Telemetry(BaseModel):
225
226
  OmniType.PUMP,
226
227
  OmniType.RELAY,
227
228
  OmniType.VALVE_ACTUATOR,
229
+ OmniType.VIRT_HEATER,
228
230
  ),
229
231
  )
230
232
  try:
@@ -9,8 +9,9 @@ import zlib
9
9
 
10
10
  from typing_extensions import Self
11
11
 
12
+ from .exceptions import OmniTimeoutException
12
13
  from .models.leadmessage import LeadMessage
13
- from .types import ClientType, MessageType, OmniTimeoutException
14
+ from .types import ClientType, MessageType
14
15
 
15
16
  _LOGGER = logging.getLogger(__name__)
16
17
 
@@ -121,7 +121,7 @@ class ColorLogicShow(PrettyEnum):
121
121
  USA = 14
122
122
  MARDI_GRAS = 15
123
123
  COOL_CABARET = 16
124
- #### THESE SHOW IN THE APP AFTER SETTING, BUT MAY NOT MATCH ALL LIGHTS
124
+ #### The below options only work on lights that support OmniDirect / V2-Active in MSPConfig
125
125
  YELLOW = 17
126
126
  ORANGE = 18
127
127
  GOLD = 19
@@ -300,15 +300,3 @@ class SensorUnits(str, PrettyEnum):
300
300
  class ValveActuatorState(PrettyEnum):
301
301
  OFF = 0
302
302
  ON = 1
303
-
304
-
305
- class OmniLogicException(Exception):
306
- pass
307
-
308
-
309
- class OmniTimeoutException(OmniLogicException):
310
- pass
311
-
312
-
313
- class OmniParsingException(OmniLogicException):
314
- pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-omnilogic-local
3
- Version: 0.5.1
3
+ Version: 0.6.1
4
4
  Summary: A library for local control of Hayward OmniHub/OmniLogic pool controllers using their local API
5
5
  Home-page: https://github.com/cryptk/python-omnilogic-local
6
6
  License: Apache-2.0
@@ -1,17 +1,18 @@
1
1
  pyomnilogic_local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  pyomnilogic_local/api.py,sha256=JpNpDcPDuCZhimyTT7YaMepi0JAFAihCTxJQJngzqq8,21453
3
3
  pyomnilogic_local/cli.py,sha256=jHAhN_VfjgEVbXlvLsPdgNSab-jY8XntpXoek0I1Vfc,3921
4
+ pyomnilogic_local/exceptions.py,sha256=7-EYTP-_VgGrA8WWGwQPUE1NGjJEDWB-ovyvSM2iaNY,164
4
5
  pyomnilogic_local/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
6
  pyomnilogic_local/models/const.py,sha256=j4HSiPJW5If296yJ-AiIsBI9EdlckF4QkVFIpTLb5C4,51
6
7
  pyomnilogic_local/models/filter_diagnostics.py,sha256=N4YWl9aEMKcWZ4QOlqR68WV9H1WjTtxjs0wHrNojAaU,1532
7
8
  pyomnilogic_local/models/leadmessage.py,sha256=9r6PbIHHzD0tyeKiFUve3WLcjS8uL2Gj6r_96X7l5H8,407
8
- pyomnilogic_local/models/mspconfig.py,sha256=tn567HXb0gUfR2qiWn78KxwZQX1xf3WFkBeWFRsM10c,8079
9
- pyomnilogic_local/models/telemetry.py,sha256=I82ShvWVzbxFT32_OrCYyPJVAfO4sZn5NhfbXrWabGE,9803
9
+ pyomnilogic_local/models/mspconfig.py,sha256=nb7Iqy8mP9GQ8vwI9NQb_-I5vwHJfhMDdUdayUmcRCg,8352
10
+ pyomnilogic_local/models/telemetry.py,sha256=IP8InR_sHYwYtgF6v7WlxqwB9nFEmW9HHFcuhZ_07D8,9968
10
11
  pyomnilogic_local/models/util.py,sha256=3Qch98NOl5eO-KIOUBnE9ar86MlzbZ0g2LRApMgj-co,1476
11
- pyomnilogic_local/protocol.py,sha256=XUxRG8X6qB1cJ-DZv92mbhse41c6ZUgMxR_N6s9GEOA,10166
12
- pyomnilogic_local/types.py,sha256=90S-7YfJLxmD6Hy6gj7npNsQ3j_zeejPcRY4zNfEQZI,6470
12
+ pyomnilogic_local/protocol.py,sha256=JxJwtjHC11FXPCK6hc5FtXnxgJ5GyNkXqpjT0cFHvb4,10189
13
+ pyomnilogic_local/types.py,sha256=PiLvBBQl-amj0P2rRa15IP0Ebrfc23IzBqZNgIhQWOA,6325
13
14
  pyomnilogic_local/util.py,sha256=agbRBKnecrYycC9iUmo1aJDjbVg9VxHyq4QY0D8-bfA,359
14
- python_omnilogic_local-0.5.1.dist-info/METADATA,sha256=frNuxLnPUBfWAaZg2DVu0ZKFFfTdIOxKE2yDVnmR5fI,2727
15
- python_omnilogic_local-0.5.1.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
16
- python_omnilogic_local-0.5.1.dist-info/entry_points.txt,sha256=PUvdumqSijeB0dHH_s5oE2TnWtPWdJSNpSOsn8yTtOo,56
17
- python_omnilogic_local-0.5.1.dist-info/RECORD,,
15
+ python_omnilogic_local-0.6.1.dist-info/METADATA,sha256=UwcSfI4kCyQG_AoLs0sjP_4yVAiU5O4HZLGUNiXI080,2727
16
+ python_omnilogic_local-0.6.1.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
17
+ python_omnilogic_local-0.6.1.dist-info/entry_points.txt,sha256=PUvdumqSijeB0dHH_s5oE2TnWtPWdJSNpSOsn8yTtOo,56
18
+ python_omnilogic_local-0.6.1.dist-info/RECORD,,