From 5eb887f5762c99ca9030b0d40d9e78b07e3c7dd1 Mon Sep 17 00:00:00 2001 From: natesmith123 Date: Mon, 31 Mar 2025 08:03:48 -0700 Subject: [PATCH 1/3] Update omnitypes.py Added additional message types for additional commands. Found by logging xml from Hayward API --- pyomnilogic_local/omnitypes.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyomnilogic_local/omnitypes.py b/pyomnilogic_local/omnitypes.py index 7e4256c..7625241 100644 --- a/pyomnilogic_local/omnitypes.py +++ b/pyomnilogic_local/omnitypes.py @@ -34,7 +34,15 @@ class MessageType(Enum): MSP_LEADMESSAGE = 1998 MSP_BLOCKMESSAGE = 1999 - + SET_DATE_TIME = 101 + CLEAR_UI_ALARM = 303 + SET_SCHEDULE = 232 + EDIT_SCHEDULE = 233 + SetUISystemStateCmd = 268 + RESET_STANDALONE_LIGHT = 309 + GET_CHLOR_RELAY_POLARITY = 174 + GET_CHLOR_MEASUREMENT= 163 + class ClientType(Enum): XML = 0 SIMPLE = 1 From 2576f166570f5ef237c9f8ce8673564499052824 Mon Sep 17 00:00:00 2001 From: natesmith123 Date: Mon, 31 Mar 2025 08:05:49 -0700 Subject: [PATCH 2/3] Update omnitypes.py --- pyomnilogic_local/omnitypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyomnilogic_local/omnitypes.py b/pyomnilogic_local/omnitypes.py index 7625241..dede4d9 100644 --- a/pyomnilogic_local/omnitypes.py +++ b/pyomnilogic_local/omnitypes.py @@ -38,7 +38,7 @@ class MessageType(Enum): CLEAR_UI_ALARM = 303 SET_SCHEDULE = 232 EDIT_SCHEDULE = 233 - SetUISystemStateCmd = 268 + SET_SYSTEM_STATE = 268 RESET_STANDALONE_LIGHT = 309 GET_CHLOR_RELAY_POLARITY = 174 GET_CHLOR_MEASUREMENT= 163 From 7a2e6ab6ab6ebac833337fb7e4bcc6a9191d05e9 Mon Sep 17 00:00:00 2001 From: natesmith123 Date: Mon, 31 Mar 2025 08:13:01 -0700 Subject: [PATCH 3/3] Update api.py Add Reset_StandAlone_Light method for resetting lights out of sync. --- pyomnilogic_local/api.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pyomnilogic_local/api.py b/pyomnilogic_local/api.py index 44b131f..e779ff5 100644 --- a/pyomnilogic_local/api.py +++ b/pyomnilogic_local/api.py @@ -439,6 +439,31 @@ async def async_set_light_show( req_body = ET.tostring(body_element, xml_declaration=True, encoding="unicode") return await self.async_send_message(MessageType.SET_STANDALONE_LIGHT_SHOW, req_body, False) + + async def async_reset_standalone_light( + self, + pool_id: int, + light_id: int + ) -> None: + """Reset ColorLogic light (Sync). + + Args: + pool_id (int): The Pool/BodyOfWater ID that you want to address + light_id (int): Which light_id within that Pool to address + """ + body_element = ET.Element("Request", {"xmlns": "http://nextgen.hayward.com/api"}) + + name_element = ET.SubElement(body_element, "Name") + name_element.text = "ResetStandAloneLight" + + parameters_element = ET.SubElement(body_element, "Parameters") + parameter = ET.SubElement(parameters_element, "Parameter", name="PoolID", dataType="int") + parameter.text = str(pool_id) + parameter = ET.SubElement(parameters_element, "Parameter", name="LightID", dataType="int", alias="equipment_id") + parameter.text = str(light_id) + + req_body = ET.tostring(body_element, xml_declaration=True, encoding="unicode") + return await self.async_send_message(MessageType.RESET_STANDALONE_LIGHT, req_body, False) async def async_set_chlorinator_enable(self, pool_id: int, enabled: int | bool) -> None: body_element = ET.Element("Request", {"xmlns": "http://nextgen.hayward.com/api"})