Skip to content

Patch 1 #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions pyomnilogic_local/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down
10 changes: 9 additions & 1 deletion pyomnilogic_local/omnitypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
SET_SYSTEM_STATE = 268
RESET_STANDALONE_LIGHT = 309
GET_CHLOR_RELAY_POLARITY = 174
GET_CHLOR_MEASUREMENT= 163

class ClientType(Enum):
XML = 0
SIMPLE = 1
Expand Down