python-omnilogic-local 0.14.3__py3-none-any.whl → 0.14.6__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
pyomnilogic_local/api.py CHANGED
@@ -436,12 +436,12 @@ class OmniLogicAPI:
436
436
  pool_id: int,
437
437
  equipment_id: int,
438
438
  timed_percent: int,
439
+ cell_type: int,
440
+ op_mode: int,
441
+ sc_timeout: int,
442
+ bow_type: int,
443
+ orp_timeout: int,
439
444
  cfg_state: int = 3,
440
- op_mode: int = 1,
441
- bow_type: int = 0,
442
- cell_type: int = 4,
443
- sc_timeout: int = 24,
444
- orp_timeout: int = 24,
445
445
  ) -> None:
446
446
  body_element = ET.Element("Request", {"xmlns": "http://nextgen.hayward.com/api"})
447
447
 
@@ -15,6 +15,7 @@ from xmltodict import parse as xml_parse
15
15
  from ..exceptions import OmniParsingException
16
16
  from ..types import (
17
17
  BodyOfWaterType,
18
+ ChlorinatorCellType,
18
19
  ChlorinatorDispenserType,
19
20
  ColorLogicLightType,
20
21
  ColorLogicShow,
@@ -151,7 +152,9 @@ class MSPChlorinator(OmniBase):
151
152
  enabled: Literal["yes", "no"] = Field(alias="Enabled")
152
153
  timed_percent: int = Field(alias="Timed-Percent")
153
154
  superchlor_timeout: int = Field(alias="SuperChlor-Timeout")
155
+ orp_timeout: int = Field(alias="ORP-Timeout")
154
156
  dispenser_type: ChlorinatorDispenserType | str = Field(alias="Dispenser-Type")
157
+ cell_type: ChlorinatorCellType = Field(alias="Cell-Type")
155
158
  chlorinator_equipment: list[MSPChlorinatorEquip] | None
156
159
 
157
160
  def __init__(self, **data: Any) -> None:
@@ -71,7 +71,7 @@ class TelemetryChlorinator(BaseModel):
71
71
  sc_mode: int = Field(alias="@scMode")
72
72
  operating_state: int = Field(alias="@operatingState")
73
73
  timed_percent: int | None = Field(alias="@Timed-Percent")
74
- operating_mode: ChlorinatorOperatingMode | int = Field(alias="@operatingMode")
74
+ operating_mode: ChlorinatorOperatingMode = Field(alias="@operatingMode")
75
75
  enable: bool = Field(alias="@enable")
76
76
 
77
77
  # Still need to do a bit more work to determine if a chlorinator is actively chlorinating
@@ -2,7 +2,7 @@ from collections.abc import Awaitable, Callable
2
2
  import logging
3
3
  from typing import Any, Literal, TypeVar, cast, overload
4
4
 
5
- from pydantic.utils import GetterDict
5
+ from pydantic.v1.utils import GetterDict
6
6
 
7
7
  from .const import XML_NS
8
8
  from .filter_diagnostics import FilterDiagnostics
@@ -1,4 +1,4 @@
1
- from enum import Enum
1
+ from enum import Enum, IntEnum
2
2
 
3
3
  from .util import PrettyEnum
4
4
 
@@ -87,7 +87,8 @@ class BodyOfWaterType(str, PrettyEnum):
87
87
  # Chlorinator status is a bitmask that we still need to figure out
88
88
  # class ChlorinatorStatus(str,Enum):
89
89
  # pass
90
- class ChlorinatorOperatingMode(PrettyEnum):
90
+ class ChlorinatorOperatingMode(IntEnum):
91
+ DISABLED = 0
91
92
  TIMED = 1
92
93
  ORP = 2
93
94
 
@@ -96,6 +97,24 @@ class ChlorinatorDispenserType(str, PrettyEnum):
96
97
  SALT = "SALT_DISPENSING"
97
98
 
98
99
 
100
+ class ChlorinatorCellType(PrettyEnum):
101
+ T3 = "CELL_TYPE_T3"
102
+ T5 = "CELL_TYPE_T5"
103
+ T9 = "CELL_TYPE_T9"
104
+ T15 = "CELL_TYPE_T15"
105
+
106
+ # There is probably an easier way to do this
107
+ def __int__(self) -> int:
108
+ return ChlorinatorCellInt[self.name].value
109
+
110
+
111
+ class ChlorinatorCellInt(IntEnum):
112
+ T3 = 1
113
+ T5 = 2
114
+ T9 = 3
115
+ T15 = 4
116
+
117
+
99
118
  # Lights
100
119
  class ColorLogicSpeed(PrettyEnum):
101
120
  ONE_SIXTEENTH = 0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: python-omnilogic-local
3
- Version: 0.14.3
3
+ Version: 0.14.6
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,19 +1,19 @@
1
1
  pyomnilogic_local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- pyomnilogic_local/api.py,sha256=3Xdd1ouAcSrSiLvmQnwrJl_3hgRl6KiloBXp0_JDVkE,28134
2
+ pyomnilogic_local/api.py,sha256=48_NxsDwZXOVgkbl1NJ4lUfNAS6qMDrRNdTr_eXBMJU,28112
3
3
  pyomnilogic_local/cli.py,sha256=RwzKydC612-ay6TGrlSg8UEQPjYIlylxjf11S062bsk,3931
4
4
  pyomnilogic_local/exceptions.py,sha256=7-EYTP-_VgGrA8WWGwQPUE1NGjJEDWB-ovyvSM2iaNY,164
5
5
  pyomnilogic_local/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  pyomnilogic_local/models/const.py,sha256=j4HSiPJW5If296yJ-AiIsBI9EdlckF4QkVFIpTLb5C4,51
7
7
  pyomnilogic_local/models/filter_diagnostics.py,sha256=DnkbjOsmfa39-sbD5qO5PV_Ltn5FHSiImrPBxr7Y0cI,1535
8
8
  pyomnilogic_local/models/leadmessage.py,sha256=XnzXTpLLQzhLQR1OgfAjKmW5N8BBgM7OrntUi1I2VRY,410
9
- pyomnilogic_local/models/mspconfig.py,sha256=mXfryaHSA8ecJGazpD_4rmrA2vhWtl32_OBmoSCmxGU,10427
10
- pyomnilogic_local/models/telemetry.py,sha256=pBebgBKLClXyLH831GzQdfxbFR7NqyMlktwZzGf1ROg,10632
11
- pyomnilogic_local/models/util.py,sha256=3Qch98NOl5eO-KIOUBnE9ar86MlzbZ0g2LRApMgj-co,1476
9
+ pyomnilogic_local/models/mspconfig.py,sha256=sa_fn5VOVlzVfZhl60ly8XkDb4T8r5om40mFE7dxV2A,10564
10
+ pyomnilogic_local/models/telemetry.py,sha256=oud_Tusqahw1bagiLFE_dN6cyC4ykMiMuRYSKrq_iMQ,10626
11
+ pyomnilogic_local/models/util.py,sha256=MgqHmDy7OE-62vFX5Rq1tRxs6GmzamBuWoaLYGm-fPI,1479
12
12
  pyomnilogic_local/protocol.py,sha256=1Z7U70mV0sUlqrp3XK1Fvj6NuChRKLz0ejzKaQLSPE8,10194
13
- pyomnilogic_local/types.py,sha256=km_tagtJ43m4_cIynalis7oiDa1LUUR-ta5B9HQUG1Q,7264
13
+ pyomnilogic_local/types.py,sha256=c9Ujw67lZFZ2V7gl-J6EVYa-OlQQig_IF0z6g5Cxw8Y,7639
14
14
  pyomnilogic_local/util.py,sha256=agbRBKnecrYycC9iUmo1aJDjbVg9VxHyq4QY0D8-bfA,359
15
- python_omnilogic_local-0.14.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
- python_omnilogic_local-0.14.3.dist-info/METADATA,sha256=k8Kin3aHuB15MaJ6rxTDiEG9mqxVZTXuLydLXwSISf0,2984
17
- python_omnilogic_local-0.14.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
18
- python_omnilogic_local-0.14.3.dist-info/entry_points.txt,sha256=PUvdumqSijeB0dHH_s5oE2TnWtPWdJSNpSOsn8yTtOo,56
19
- python_omnilogic_local-0.14.3.dist-info/RECORD,,
15
+ python_omnilogic_local-0.14.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
+ python_omnilogic_local-0.14.6.dist-info/METADATA,sha256=nYBd5MLkh270MdCpAGd_LZOKje_MVdExeF25GqGsL0s,2984
17
+ python_omnilogic_local-0.14.6.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
18
+ python_omnilogic_local-0.14.6.dist-info/entry_points.txt,sha256=PUvdumqSijeB0dHH_s5oE2TnWtPWdJSNpSOsn8yTtOo,56
19
+ python_omnilogic_local-0.14.6.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: poetry-core 2.0.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any