Skip to content
Closed
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
16 changes: 14 additions & 2 deletions homeassistant/components/pooldose/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
"orp": {
"default": "mdi:water-check"
},
"cl": {
"default": "mdi:pool"
},
"flow_rate": {
"default": "mdi:pipe-valve"
},
"ph_type_dosing": {
"default": "mdi:flask"
},
"peristaltic_ph_dosing": {
"default": "mdi:pump"
},
"ofa_ph_value": {
"ofa_ph_time": {
"default": "mdi:clock"
},
"orp_type_dosing": {
Expand All @@ -19,7 +25,13 @@
"peristaltic_orp_dosing": {
"default": "mdi:pump"
},
"ofa_orp_value": {
"cl_type_dosing": {
"default": "mdi:flask"
},
"peristaltic_cl_dosing": {
"default": "mdi:pump"
},
"ofa_orp_time": {
"default": "mdi:clock"
},
"ph_calibration_type": {
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/pooldose/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"documentation": "https://www.home-assistant.io/integrations/pooldose",
"iot_class": "local_polling",
"quality_scale": "bronze",
"requirements": ["python-pooldose==0.7.0"]
"requirements": ["python-pooldose==0.7.8"]
}
48 changes: 43 additions & 5 deletions homeassistant/components/pooldose/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
SensorEntity,
SensorEntityDescription,
)
from homeassistant.const import EntityCategory, UnitOfElectricPotential, UnitOfTime
from homeassistant.const import (
CONCENTRATION_PARTS_PER_MILLION,
EntityCategory,
UnitOfElectricPotential,
UnitOfTime,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback

Expand All @@ -32,6 +37,17 @@
device_class=SensorDeviceClass.VOLTAGE,
native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT,
),
SensorEntityDescription(
key="cl",
translation_key="cl",
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
),
SensorEntityDescription(
key="flow_rate",
translation_key="flow_rate",
device_class=SensorDeviceClass.VOLUME_FLOW_RATE,
# Unit dynamically determined via API
),
SensorEntityDescription(
key="ph_type_dosing",
translation_key="ph_type_dosing",
Expand All @@ -48,8 +64,8 @@
options=["proportional", "on_off", "timed"],
),
SensorEntityDescription(
key="ofa_ph_value",
translation_key="ofa_ph_value",
key="ofa_ph_time",
translation_key="ofa_ph_time",
entity_category=EntityCategory.DIAGNOSTIC,
device_class=SensorDeviceClass.DURATION,
entity_registry_enabled_default=False,
Expand All @@ -72,8 +88,24 @@
options=["off", "proportional", "on_off", "timed"],
),
SensorEntityDescription(
key="ofa_orp_value",
translation_key="ofa_orp_value",
key="cl_type_dosing",
translation_key="cl_type_dosing",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.ENUM,
options=["low", "high"],
),
SensorEntityDescription(
key="peristaltic_cl_dosing",
translation_key="peristaltic_cl_dosing",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.ENUM,
options=["off", "proportional", "on_off", "timed"],
),
SensorEntityDescription(
key="ofa_orp_time",
translation_key="ofa_orp_time",
device_class=SensorDeviceClass.DURATION,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
Expand Down Expand Up @@ -180,4 +212,10 @@ def native_unit_of_measurement(self) -> str | None:
):
return data["unit"] # °C or °F

if (
self.entity_description.key == "flow_rate"
and (data := self.get_data()) is not None
):
return data.get("unit") # m3/h or L/s

return super().native_unit_of_measurement
26 changes: 24 additions & 2 deletions homeassistant/components/pooldose/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
"orp": {
"name": "ORP"
},
"cl": {
"name": "Chlorine"
},
"flow_rate": {
"name": "Flow rate"
},
"ph_type_dosing": {
"name": "pH dosing type",
"state": {
Expand All @@ -53,7 +59,7 @@
"timed": "Timed"
}
},
"ofa_ph_value": {
"ofa_ph_time": {
"name": "pH overfeed alert time"
},
"orp_type_dosing": {
Expand All @@ -72,7 +78,23 @@
"timed": "[%key:component::pooldose::entity::sensor::peristaltic_ph_dosing::state::timed%]"
}
},
"ofa_orp_value": {
"cl_type_dosing": {
"name": "Chlorine dosing type",
"state": {
"low": "[%key:common::state::low%]",
"high": "[%key:common::state::high%]"
}
},
"peristaltic_cl_dosing": {
"name": "Chlorine peristaltic dosing",
"state": {
"off": "[%key:common::state::off%]",
"proportional": "[%key:component::pooldose::entity::sensor::peristaltic_ph_dosing::state::proportional%]",
"on_off": "[%key:component::pooldose::entity::sensor::peristaltic_ph_dosing::state::on_off%]",
"timed": "[%key:component::pooldose::entity::sensor::peristaltic_ph_dosing::state::timed%]"
}
},
"ofa_orp_time": {
"name": "ORP overfeed alert time"
},
"ph_calibration_type": {
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt

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

2 changes: 1 addition & 1 deletion requirements_test_all.txt

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

28 changes: 18 additions & 10 deletions tests/components/pooldose/fixtures/instantvalues.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
"value": 718,
"unit": "mV"
},
"cl": {
"value": 1.2,
"unit": "ppm"
},
"flow_rate": {
"value": 150,
"unit": "L/s"
},
"ph_type_dosing": {
"value": "alcalyne",
"unit": null
Expand All @@ -20,7 +28,7 @@
"value": "proportional",
"unit": null
},
"ofa_ph_value": {
"ofa_ph_time": {
"value": 0,
"unit": "min"
},
Expand All @@ -32,7 +40,7 @@
"value": "proportional",
"unit": null
},
"ofa_orp_value": {
"ofa_orp_time": {
"value": 0,
"unit": "min"
},
Expand Down Expand Up @@ -62,25 +70,25 @@
}
},
"binary_sensor": {
"pump_running": {
"pump_alarm": {
"value": true
},
"ph_level_ok": {
"ph_level_alarm": {
"value": false
},
"orp_level_ok": {
"orp_level_alarm": {
"value": false
},
"flow_rate_ok": {
"flow_rate_alarm": {
"value": false
},
"alarm_relay": {
"value": true
},
"relay_aux1_ph": {
"relay_aux1": {
"value": false
},
"relay_aux2_orpcl": {
"relay_aux2": {
"value": false
}
},
Expand Down Expand Up @@ -108,10 +116,10 @@
}
},
"switch": {
"stop_pool_dosing": {
"pause_dosing": {
"value": false
},
"pump_detection": {
"pump_monitoring": {
"value": true
},
"frequency_input": {
Expand Down
Loading
Loading