Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into rework_unique_id_logic
Browse files Browse the repository at this point in the history
  • Loading branch information
remuslazar committed Jan 5, 2025
2 parents 87577ea + 3420ab3 commit 9229ca3
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Luxtronik

[![Validate with hassfest](https://github.com/Bouni/luxtronik/actions/workflows/hassfest.yml/badge.svg)](https://github.com/Bouni/luxtronik/actions/workflows/hassfest.yml)
[![Validate with HACS action](https://github.com/Bouni/luxtronik/actions/workflows/main.yml/badge.svg)](https://github.com/Bouni/luxtronik/actions/workflows/hacs.yml)
[![HACS Action](https://github.com/Bouni/luxtronik/actions/workflows/hacs.yaml/badge.svg)](https://github.com/Bouni/luxtronik/actions/workflows/hacs.yaml)
[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg)](https://github.com/hacs/integration)

<a href="https://ko-fi.com/I3I364QTM" target="_blank"><img src="https://ko-fi.com/img/githubbutton_sm.svg" height="30px"/></a> <a href="https://www.buymeacoffee.com/bouni" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" height="30px"/></a> <a href="https://github.com/sponsors/Bouni" target="_blank"><img src="https://img.shields.io/badge/-Github Sponsor-fafbfc?style=flat&logo=GitHub%20Sponsors" height="30px"/></a>
Expand Down
59 changes: 31 additions & 28 deletions custom_components/luxtronik/const.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
"""Constants for the Luxtronik integration."""

from homeassistant.const import (
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_TIMESTAMP,
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
DEVICE_CLASS_FREQUENCY,
ENERGY_KILO_WATT_HOUR,
PRESSURE_BAR,
TEMP_CELSIUS,
UnitOfTemperature,
UnitOfTime,
UnitOfPressure,
UnitOfEnergy,
UnitOfElectricPotential,
UnitOfPower,
UnitOfFrequency,
PERCENTAGE
)
from homeassistant.components.sensor import SensorDeviceClass

ATTR_PARAMETER = "parameter"
ATTR_VALUE = "value"
Expand All @@ -21,6 +22,7 @@
CONF_PARAMETERS = "parameters"
CONF_CALCULATIONS = "calculations"
CONF_VISIBILITIES = "visibilities"

CONF_CELSIUS = "celsius"
CONF_SECONDS = "seconds"
CONF_TIMESTAMP = "timestamp"
Expand All @@ -33,6 +35,7 @@
CONF_FLOW = "flow"
CONF_WATT = "W"
CONF_FREQUENCY = "Hz"

CONF_LOCK_TIMEOUT = "lock_timeout"
CONF_UPDATE_IMMEDIATELY_AFTER_WRITE = "update_immediately_after_write"

Expand All @@ -59,27 +62,27 @@
}

DEVICE_CLASSES = {
CONF_CELSIUS: DEVICE_CLASS_TEMPERATURE,
CONF_KELVIN: DEVICE_CLASS_TEMPERATURE,
CONF_BAR: DEVICE_CLASS_PRESSURE,
CONF_SECONDS: DEVICE_CLASS_TIMESTAMP,
CONF_HOURS: DEVICE_CLASS_TIMESTAMP,
CONF_TIMESTAMP: DEVICE_CLASS_TIMESTAMP,
CONF_ENERGY: DEVICE_CLASS_ENERGY,
CONF_WATT: DEVICE_CLASS_POWER,
CONF_FREQUENCY: DEVICE_CLASS_FREQUENCY,
CONF_CELSIUS: SensorDeviceClass.TEMPERATURE,
CONF_KELVIN: SensorDeviceClass.TEMPERATURE,
CONF_BAR: SensorDeviceClass.PRESSURE,
CONF_SECONDS: SensorDeviceClass.DURATION,
CONF_HOURS: SensorDeviceClass.DURATION,
CONF_TIMESTAMP: SensorDeviceClass.TIMESTAMP,
CONF_ENERGY: SensorDeviceClass.ENERGY,
CONF_WATT: SensorDeviceClass.POWER,
CONF_FREQUENCY: SensorDeviceClass.FREQUENCY,
}

UNITS = {
CONF_CELSIUS: TEMP_CELSIUS,
CONF_SECONDS: "s",
CONF_KELVIN: "K",
CONF_BAR: PRESSURE_BAR,
CONF_PERCENT: "%",
CONF_ENERGY: ENERGY_KILO_WATT_HOUR,
CONF_VOLTAGE: "V",
CONF_HOURS: "h",
CONF_CELSIUS: UnitOfTemperature.CELSIUS,
CONF_SECONDS: UnitOfTime.SECONDS,
CONF_KELVIN: UnitOfTemperature.KELVIN,
CONF_BAR: UnitOfPressure.BAR,
CONF_PERCENT: PERCENTAGE,
CONF_ENERGY: UnitOfEnergy.KILO_WATT_HOUR,
CONF_VOLTAGE: UnitOfElectricPotential.VOLT,
CONF_HOURS: UnitOfTime.HOURS,
CONF_FLOW: "l/h",
CONF_WATT: "W",
CONF_FREQUENCY: "Hz"
CONF_WATT: UnitOfPower.WATT,
CONF_FREQUENCY: UnitOfFrequency.HERTZ
}
15 changes: 5 additions & 10 deletions custom_components/luxtronik/manifest.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{
"domain": "luxtronik",
"name": "Luxtronik",
"version": "2022.12.01",
"iot_class": "local_polling",
"codeowners": ["@bouni"],
"dependencies": [],
"documentation": "https://www.home-assistant.io/integrations/luxtronik",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/Bouni/luxtronik/issues",
"requirements": [
"luxtronik==0.3.14"
],
"dependencies": [],
"codeowners": [
"@bouni"
]
"requirements": ["luxtronik==0.3.14"],
"version": "2022.12.01"
}

9 changes: 6 additions & 3 deletions custom_components/luxtronik/services.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
write:
name: luxtronik-write
description: Write a parameter on the luxtronik heatpump.
fields:
parameter:
parameter:
name: parameter
description: ID of the value to write.
example: "ID_Ba_Bw_akt"
value:
description: Value to write.
value:
name: value
description: Value to write.
example: "Automatic"
3 changes: 2 additions & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "Luxtronik",
"render_readme": true
"render_readme": true,
"homeassistant": "2023.1.0"
}

0 comments on commit 9229ca3

Please sign in to comment.