Skip to content

Commit

Permalink
fix: specify correct chlorinator settings, fixes #108 (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptk authored Jan 8, 2025
1 parent 7145552 commit 1c0a352
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
7 changes: 5 additions & 2 deletions custom_components/omnilogic_local/coordinator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example integration using DataUpdateCoordinator."""

from __future__ import annotations

from collections.abc import Iterable
Expand Down Expand Up @@ -73,8 +74,10 @@ async def _async_update_data(self) -> dict[int, EntityIndexData]:
if SIMULATION:
_LOGGER.debug("Simulating Omni MSPConfig and Telemetry")
test_data = json.loads(TEST_DIAGNOSTIC_DATA.replace(r"\"", r"'"))
self.msp_config = MSPConfig.load_xml(test_data["data"]["msp_config"])
self.telemetry = Telemetry.load_xml(test_data["data"]["telemetry"])
self.msp_config_xml = test_data["data"]["msp_config"]
self.msp_config = MSPConfig.load_xml(self.msp_config_xml)
self.telemetry_xml = test_data["data"]["telemetry"]
self.telemetry = Telemetry.load_xml(self.telemetry_xml)

else:
# Initially we only pulled the msp_config at integration startup as it rarely changes
Expand Down
4 changes: 2 additions & 2 deletions custom_components/omnilogic_local/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"issue_tracker": "https://github.com/cryptk/haomnilogic-local/issues",
"loggers": ["pyomnilogic_local"],
"requirements": [
"python_omnilogic_local==0.14.4"
"python_omnilogic_local==0.14.6"
],
"ssdp": [],
"version": "0.7.7",
"version": "0.7.8",
"zeroconf": []
}
11 changes: 10 additions & 1 deletion custom_components/omnilogic_local/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,5 +283,14 @@ async def async_set_native_value(self, value: float) -> None:
case BodyOfWaterType.SPA:
bow_type = 1

await self.coordinator.omni_api.async_set_chlorinator_params(self.bow_id, self.system_id, int(value), bow_type=bow_type)
await self.coordinator.omni_api.async_set_chlorinator_params(
pool_id=self.bow_id,
equipment_id=self.system_id,
timed_percent=int(value),
cell_type=int(self.data.msp_config.cell_type),
op_mode=self.data.telemetry.operating_mode,
sc_timeout=self.data.msp_config.superchlor_timeout,
orp_timeout=self.data.msp_config.orp_timeout,
bow_type=bow_type,
)
self.set_telemetry({"timed_percent": int(value)})
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "haomnilogic-local"
version = "0.7.7"
version = "0.7.8"
description = "A Home Assistant integration for Hayward OmniLogic/OmniHub pool controllers using the local UDP api"
readme = "README.md"
authors = [
Expand All @@ -21,7 +21,7 @@ package-mode = false
pre-commit = "^3.0.0"
mypy = "^1.2.0"
homeassistant = "^2024.6.0"
python_omnilogic_local = "0.14.3"
python_omnilogic_local = "0.14.6"
pylint = "^2.17.0"
pydantic = "^1.10.7"
pytest = "^7.3.1"
Expand Down

0 comments on commit 1c0a352

Please sign in to comment.