Skip to content

Commit

Permalink
Update PyPlumIO to 0.5.3.
Browse files Browse the repository at this point in the history
- Update key names.
- Update tests.
- Add unit of measurements to "get_parameter" service response.
  • Loading branch information
denpamusic committed Nov 17, 2023
1 parent 7a31059 commit 6711e00
Show file tree
Hide file tree
Showing 21 changed files with 235 additions and 304 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pyplumio==0.5.2 pytest-homeassistant-custom-component psutil-home-assistant fnv-hash-fast aiohttp_cors mypy pylint flake8 flake8-pyproject black
python -m pip install pyplumio==0.5.3 pytest-homeassistant-custom-component psutil-home-assistant fnv-hash-fast aiohttp_cors mypy pylint flake8 flake8-pyproject black
- name: Check typing
run: |
Expand Down
2 changes: 1 addition & 1 deletion custom_components/plum_ecomax/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"pyplumio"
],
"requirements": [
"pyplumio==0.5.2"
"pyplumio==0.5.3"
],
"version": "0.3.16"
}
4 changes: 2 additions & 2 deletions custom_components/plum_ecomax/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class EcomaxNumberEntityDescription(NumberEntityDescription):
product_types={ProductType.ECOMAX_P},
),
EcomaxNumberEntityDescription(
key="fuel_calorific_value_kwh_kg",
key="fuel_calorific_value",
translation_key="fuel_calorific_value",
mode=NumberMode.BOX,
native_step=0.1,
Expand Down Expand Up @@ -156,7 +156,7 @@ class EcomaxMixerNumberEntityDescription(EcomaxNumberEntityDescription):
product_types={ProductType.ECOMAX_P},
),
EcomaxMixerNumberEntityDescription(
key="mixer_target_temp",
key="circuit_target_temp",
translation_key="target_circuit_temp",
native_step=1,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
Expand Down
8 changes: 4 additions & 4 deletions custom_components/plum_ecomax/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ class EcomaxSensorEntityDescription(SensorEntityDescription):
value_fn=lambda x: x,
),
EcomaxSensorEntityDescription(
key="power",
translation_key="power",
key="boiler_power",
translation_key="boiler_power",
device_class=SensorDeviceClass.POWER,
icon="mdi:radiator",
native_unit_of_measurement=UnitOfPower.KILO_WATT,
Expand Down Expand Up @@ -206,8 +206,8 @@ class EcomaxSensorEntityDescription(SensorEntityDescription):
value_fn=lambda x: x,
),
EcomaxSensorEntityDescription(
key="load",
translation_key="load",
key="boiler_load",
translation_key="boiler_load",
icon="mdi:gauge",
native_unit_of_measurement=PERCENTAGE,
product_types={ProductType.ECOMAX_P},
Expand Down
7 changes: 6 additions & 1 deletion custom_components/plum_ecomax/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
SelectedEntities,
async_extract_referenced_entity_ids,
)
from pyplumio.const import UnitOfMeasurement
from pyplumio.devices import Device
from pyplumio.exceptions import ParameterNotFoundError
from pyplumio.helpers.parameter import Parameter
from pyplumio.helpers.schedule import (
START_OF_DAY,
STATE_DAY,
Expand Down Expand Up @@ -143,7 +145,7 @@ async def async_get_device_parameter(
) -> dict[str, Any] | None:
"""Get device parameter."""
try:
parameter = await device.get(name)
parameter: Parameter = await device.get(name)
except (ParameterNotFoundError, TimeoutError):
_LOGGER.exception("Requested parameter %s not found", name)
return None
Expand All @@ -157,6 +159,9 @@ async def async_get_device_parameter(
"value": parameter.value,
"min_value": parameter.min_value,
"max_value": parameter.max_value,
"unit_of_measurement": parameter.unit_of_measurement.value
if isinstance(parameter.unit_of_measurement, UnitOfMeasurement)
else parameter.unit_of_measurement,
"device_type": device.__class__.__name__.lower(),
"device_uid": device_uid,
"device_index": device.index + 1 if hasattr(device, "index") else 0,
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plum_ecomax/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@
"software_version": { "name": "Software version" },
"uid": { "name": "UID" },
"oxygen_level": { "name": "Oxygen level" },
"power": { "name": "Power" },
"boiler_power": { "name": "Boiler power" },
"fuel_level": { "name": "Fuel level" },
"fuel_consumption": { "name": "Fuel consumption" },
"load": { "name": "Load" },
"boiler_load": { "name": "Boiler load" },
"fan_power": { "name": "Fan power" },
"flame_intensity": { "name": "Flame intensity" },
"feeder_temp": { "name": "Feeder temperature" },
Expand Down
2 changes: 1 addition & 1 deletion custom_components/plum_ecomax/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class MixerSwitchEntityDescription(EcomaxSwitchEntityDescription):
product_types={ProductType.ECOMAX_P},
),
MixerSwitchEntityDescription(
key="thermostat_disable_pump",
key="disable_pump_on_thermostat",
translation_key="disable_pump_on_thermostat",
product_types={ProductType.ECOMAX_P},
),
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plum_ecomax/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@
"software_version": { "name": "Software version" },
"uid": { "name": "UID" },
"oxygen_level": { "name": "Oxygen level" },
"power": { "name": "Power" },
"boiler_power": { "name": "Boiler power" },
"fuel_level": { "name": "Fuel level" },
"fuel_consumption": { "name": "Fuel consumption" },
"load": { "name": "Load" },
"boiler_load": { "name": "Boiler load" },
"fan_power": { "name": "Fan power" },
"flame_intensity": { "name": "Flame intensity" },
"feeder_temp": { "name": "Feeder temperature" },
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plum_ecomax/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@
"software_version": { "name": "Software version" },
"uid": { "name": "UID" },
"oxygen_level": { "name": "Oxygen level" },
"power": { "name": "Power" },
"boiler_power": { "name": "Boiler power" },
"fuel_level": { "name": "Fuel level" },
"fuel_consumption": { "name": "Fuel consumption" },
"load": { "name": "Load" },
"boiler_load": { "name": "Boiler load" },
"fan_power": { "name": "Fan power" },
"flame_intensity": { "name": "Flame intensity" },
"feeder_temp": { "name": "Feeder temperature" },
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plum_ecomax/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@
"software_version": { "name": "Software version" },
"uid": { "name": "UID" },
"oxygen_level": { "name": "Oxygen level" },
"power": { "name": "Power" },
"boiler_power": { "name": "Boiler power" },
"fuel_level": { "name": "Fuel level" },
"fuel_consumption": { "name": "Fuel consumption" },
"load": { "name": "Load" },
"boiler_load": { "name": "Boiler load" },
"fan_power": { "name": "Fan power" },
"flame_intensity": { "name": "Flame intensity" },
"feeder_temp": { "name": "Feeder temperature" },
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plum_ecomax/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@
"software_version": { "name": "Wersja oprogramowania" },
"uid": { "name": "UID" },
"oxygen_level": { "name": "Poziom tlenu" },
"power": { "name": "Moc" },
"boiler_power": { "name": "Moc kotła" },
"fuel_level": { "name": "Poziom paliwa" },
"fuel_consumption": { "name": "Zużycie paliwa" },
"load": { "name": "Poziom obciążenia kotła" },
"boiler_load": { "name": "Poziom obciążenia kotła" },
"fan_power": { "name": "Moc wentylatora" },
"flame_intensity": { "name": "Intensywność płomienia" },
"feeder_temp": { "name": "Temperatura podajnika" },
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plum_ecomax/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@
"software_version": { "name": "Версия ПО" },
"uid": { "name": "UID" },
"oxygen_level": { "name": "Содержание кислорода" },
"power": { "name": "Мощность" },
"boiler_power": { "name": "Мощность" },
"fuel_level": { "name": "Уровень топлива" },
"fuel_consumption": { "name": "Потребление топлива" },
"load": { "name": "Нагрузка" },
"boiler_load": { "name": "Нагрузка" },
"fan_power": { "name": "Производительность вентелятора" },
"flame_intensity": { "name": "Интенсивность пламени" },
"feeder_temp": { "name": "Температура механизма подачи" },
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plum_ecomax/translations/ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@
"software_version": { "name": "Software version" },
"uid": { "name": "UID" },
"oxygen_level": { "name": "Oxygen level" },
"power": { "name": "Power" },
"boiler_power": { "name": "Boiler power" },
"fuel_level": { "name": "Fuel level" },
"fuel_consumption": { "name": "Fuel consumption" },
"load": { "name": "Load" },
"boiler_load": { "name": "Boiler load" },
"fan_power": { "name": "Fan power" },
"flame_intensity": { "name": "Flame intensity" },
"feeder_temp": { "name": "Feeder temperature" },
Expand Down
Loading

0 comments on commit 6711e00

Please sign in to comment.