Skip to content

Commit

Permalink
* Extend update sensor text
Browse files Browse the repository at this point in the history
  • Loading branch information
BenPru committed Oct 29, 2023
1 parent 02dc566 commit 272d692
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion custom_components/luxtronik/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# endregion Imports


class LuxtronikEntity(CoordinatorEntity[LuxtronikCoordinator], RestoreSensor):
class LuxtronikEntity(CoordinatorEntity[LuxtronikCoordinator], RestoreEntity):
"""Luxtronik base device."""

entity_description: LuxtronikEntityDescription
Expand Down
5 changes: 2 additions & 3 deletions custom_components/luxtronik/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,13 @@ class FirmwareVersionMinor(Enum):
DOWNLOAD_PORTAL_URL: Final = (
"https://www.heatpump24.com/software/fetchSoftware.php?softwareID="
)
FIRMWARE_UPDATE_MANUAL_EN = "https://www.alpha-innotec.com/en/services/customer-support/software-center"
FIRMWARE_UPDATE_MANUAL_DE = "https://www.alpha-innotec.com/de/services/kundendienst/software-center"
# endregion Constants Main

# region Conf
LANG_EN: Final = "en"
LANG_DE: Final = "de"
LANG_DEFAULT: Final = LANG_EN
LANGUAGES: Final = Enum("en", "de")
LANGUAGES_SENSOR_NAMES: Final = [LANG_EN, LANG_DE]


PRESET_SECOND_HEATSOURCE: Final = "second_heatsource"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/luxtronik/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"after_dependencies": [],
"codeowners": ["@BenPru"],
"iot_class": "local_polling",
"version": "2023.10.27",
"version": "2023.10.28",
"homeassistant": "2023.1.0",
"dhcp": [
{ "macaddress": "000E8C*" },
Expand Down
19 changes: 14 additions & 5 deletions custom_components/luxtronik/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
CONF_HA_SENSOR_PREFIX,
DOMAIN,
DOWNLOAD_PORTAL_URL,
FIRMWARE_UPDATE_MANUAL_DE,
FIRMWARE_UPDATE_MANUAL_EN,
LANG_DE,
LOGGER,
DeviceKey,
LuxCalculation,
Expand Down Expand Up @@ -113,12 +116,18 @@ def release_notes(self) -> str | None:
release_url = get_manufacturer_firmware_url_by_model(self.coordinator.model)
download_id = get_firmware_download_id(self.installed_version)
download_url = f"{DOWNLOAD_PORTAL_URL}{download_id}"
if self.state:
upgrade_text = f"For your {self.coordinator.manufacturer} {self.coordinator.model} (Download ID {download_id}) is Firmware Version {self.__firmware_version_available} available.<br><br>"
manual_url = (
FIRMWARE_UPDATE_MANUAL_DE
if self.hass.config.language == LANG_DE
else FIRMWARE_UPDATE_MANUAL_EN
)
return (
f'{upgrade_text}<a href="{release_url}" target="_blank" rel="noreferrer noopener">Firmware Download Portal</a>&emsp;'
+ f'<a href="{download_url}" target="_blank" rel="noreferrer noopener">Direct Download</a><br><br>'
+ "alpha innotec doesn't provide a changelog.<br>Please contact support for more information."
f'For your <a href="{release_url}" target="_blank" rel="noreferrer noopener">'
f"{self.coordinator.manufacturer} {self.coordinator.model} (Download ID {download_id})</a> is "
f'<a href="{download_url}" target="_blank" rel="noreferrer noopener">Firmware Version {self.__firmware_version_available}</a> available.<br>'
f'<a href="{manual_url}" target="_blank" rel="noreferrer noopener">Firmware Update Instructions</a><br><br>'
"The Install-Button downside has no function. It is only needed to notify in Home Assistant.<br><br>"
"alpha innotec doesn't provide a changelog.<br>Please contact support for more information."
)

@Throttle(MIN_TIME_BETWEEN_UPDATES)
Expand Down

0 comments on commit 272d692

Please sign in to comment.