From 4dc4d887e0ca229c4dba9befac4f481e0698799d Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sun, 16 Jun 2024 21:36:24 +0200 Subject: [PATCH 1/8] v3.3.0 Signed-off-by: Ludy87 --- custom_components/ecotrend_ista/__init__.py | 4 ++-- custom_components/ecotrend_ista/manifest.json | 3 ++- custom_components/ecotrend_ista/sensor.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/custom_components/ecotrend_ista/__init__.py b/custom_components/ecotrend_ista/__init__.py index ec6cd9d..2172610 100644 --- a/custom_components/ecotrend_ista/__init__.py +++ b/custom_components/ecotrend_ista/__init__.py @@ -52,12 +52,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: _LOGGER.debug("Configure based on config entry %s", entry.entry_id) coordinator = IstaDataUpdateCoordinator(hass, entry) await coordinator.init() - for uuid in coordinator.controller.getUUIDs(): + for uuid in coordinator.controller.get_uuids(): await _async_migrate_entries( hass, entry, uuid, - coordinator.controller.getSupportCode(), + coordinator.controller.get_support_code(), ) await coordinator.async_config_entry_first_refresh() diff --git a/custom_components/ecotrend_ista/manifest.json b/custom_components/ecotrend_ista/manifest.json index a533ef7..166f4be 100644 --- a/custom_components/ecotrend_ista/manifest.json +++ b/custom_components/ecotrend_ista/manifest.json @@ -15,5 +15,6 @@ "pyotp==2.8.0", "marshmallow-enum==1.5.1" ], - "version": "v3.2.0" + "loggers": ["pyecotrend_ista"], + "version": "v3.3.0" } diff --git a/custom_components/ecotrend_ista/sensor.py b/custom_components/ecotrend_ista/sensor.py index 191641f..0b0e086 100644 --- a/custom_components/ecotrend_ista/sensor.py +++ b/custom_components/ecotrend_ista/sensor.py @@ -51,7 +51,7 @@ def __init__(self, coordinator: IstaDataUpdateCoordinator, controller: PyEcotren manufacturer=f"{MANUFACTURER} {self.uuid}", model="ista consumption & costs", name=f"{DEVICE_NAME} {self.uuid} {'' if controller._accessToken != 'Demo' else 'Demo'}", - sw_version=controller.getVersion(), + sw_version=controller.get_version(), hw_version=controller._a_tosUpdated, via_device=(DOMAIN, f"{self.uuid}"), ) From 61a16e4fa0ff777cd536014b4e3f7c47e86b1136 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sun, 16 Jun 2024 21:47:52 +0200 Subject: [PATCH 2/8] Update manifest.json --- custom_components/ecotrend_ista/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ecotrend_ista/manifest.json b/custom_components/ecotrend_ista/manifest.json index 166f4be..7f213d3 100644 --- a/custom_components/ecotrend_ista/manifest.json +++ b/custom_components/ecotrend_ista/manifest.json @@ -10,11 +10,11 @@ "integration_type": "device", "iot_class": "cloud_polling", "issue_tracker": "https://github.com/Ludy87/ecotrend-ista/issues", + "loggers": ["pyecotrend_ista"], "requirements": [ "pyecotrend_ista==3.2.0", "pyotp==2.8.0", "marshmallow-enum==1.5.1" ], - "loggers": ["pyecotrend_ista"], "version": "v3.3.0" } From 08a776f1d3963d89a35dfd3cb0368bf69cb2a955 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sun, 23 Jun 2024 22:07:37 +0200 Subject: [PATCH 3/8] Update config_flow.py --- custom_components/ecotrend_ista/config_flow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/ecotrend_ista/config_flow.py b/custom_components/ecotrend_ista/config_flow.py index 67af662..0dea856 100644 --- a/custom_components/ecotrend_ista/config_flow.py +++ b/custom_components/ecotrend_ista/config_flow.py @@ -31,7 +31,7 @@ def login_account(hass: core.HomeAssistant, data: MappingProxyType[str, Any], de email=data.get(CONF_EMAIL, None), password=data.get(CONF_PASSWORD, None), logger=_LOGGER, - hass_dir=(hass.config.path("custom_components/ecotrend_ista") if demo else None), + # hass_dir=(hass.config.path("custom_components/ecotrend_ista") if demo else None), totp=data.get(CONF_MFA, "").replace(" ", ""), session=requests.Session(), ) @@ -70,7 +70,7 @@ async def validate_input(hass: core.HomeAssistant, data: dict[str, Any]) -> dict raise requests.Timeout from error return { - "title": f"{MANUFACTURER} {account.getSupportCode()} {'' if not login_info or login_info != 'Demo' else login_info}" + "title": f"{MANUFACTURER} {account.get_support_code()} {'' if not login_info or login_info != 'Demo' else login_info}" } From a0d3d19991d16bca4a9989884395a7ca169e3c14 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sun, 23 Jun 2024 22:07:45 +0200 Subject: [PATCH 4/8] Update entity.py --- custom_components/ecotrend_ista/entity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ecotrend_ista/entity.py b/custom_components/ecotrend_ista/entity.py index 68ef1e0..d48ade8 100644 --- a/custom_components/ecotrend_ista/entity.py +++ b/custom_components/ecotrend_ista/entity.py @@ -93,7 +93,6 @@ class EcotrendSensorEntityDescription(SensorEntityDescription, EcotrendRequiredK EcotrendSensorEntityDescription( key=CONF_TYPE_HEATING, data_type=CONF_TYPE_HEATING, - native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, entity_category=EntityCategory.DIAGNOSTIC, @@ -112,6 +111,7 @@ class EcotrendSensorEntityDescription(SensorEntityDescription, EcotrendRequiredK EcotrendSensorEntityDescription( key=CONF_TYPE_HEATING_CUSTOM, data_type=CONF_TYPE_HEATING, + native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, state_class=SensorStateClass.TOTAL_INCREASING, entity_category=EntityCategory.DIAGNOSTIC, icon="mdi:radiator", From 3860f8af4d95e6fed4dc30240b9fa013c5eddf46 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sun, 23 Jun 2024 22:07:49 +0200 Subject: [PATCH 5/8] Update manifest.json --- custom_components/ecotrend_ista/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ecotrend_ista/manifest.json b/custom_components/ecotrend_ista/manifest.json index 7f213d3..16f3809 100644 --- a/custom_components/ecotrend_ista/manifest.json +++ b/custom_components/ecotrend_ista/manifest.json @@ -12,7 +12,7 @@ "issue_tracker": "https://github.com/Ludy87/ecotrend-ista/issues", "loggers": ["pyecotrend_ista"], "requirements": [ - "pyecotrend_ista==3.2.0", + "pyecotrend_ista==3.3.1", "pyotp==2.8.0", "marshmallow-enum==1.5.1" ], From fa6a91728ea377d052f02302172be83a1cfa34d2 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sun, 23 Jun 2024 22:07:55 +0200 Subject: [PATCH 6/8] Update sensor.py --- custom_components/ecotrend_ista/sensor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/ecotrend_ista/sensor.py b/custom_components/ecotrend_ista/sensor.py index 0b0e086..f7a9357 100644 --- a/custom_components/ecotrend_ista/sensor.py +++ b/custom_components/ecotrend_ista/sensor.py @@ -44,15 +44,15 @@ def __init__(self, coordinator: IstaDataUpdateCoordinator, controller: PyEcotren """Initialize the ista EcoTrend Version 3 base entity.""" super().__init__(coordinator) self._attr_attribution = f"Data provided by {URL_SELECTORS.get(self.coordinator.config_entry.options.get(CONF_URL))}" - self._support_code = controller._supportCode + self._support_code = controller._support_code self.uuid = uuid self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, f"{self.uuid}")}, manufacturer=f"{MANUFACTURER} {self.uuid}", model="ista consumption & costs", - name=f"{DEVICE_NAME} {self.uuid} {'' if controller._accessToken != 'Demo' else 'Demo'}", + name=f"{DEVICE_NAME} {self.uuid} {'' if controller._access_token != 'Demo' else 'Demo'}", sw_version=controller.get_version(), - hw_version=controller._a_tosUpdated, + hw_version=controller._account.get("tosUpdated"), via_device=(DOMAIN, f"{self.uuid}"), ) self._unsub_dispatchers: list[Callable[[], None]] = [] From d3080a4ad933f9d142278134b08a757eb7d391e2 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sun, 23 Jun 2024 22:08:23 +0200 Subject: [PATCH 7/8] Update hacs.json --- hacs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hacs.json b/hacs.json index 3760f1e..5be4b21 100644 --- a/hacs.json +++ b/hacs.json @@ -3,7 +3,7 @@ "zip_release": true, "country": "DE", "render_readme": true, - "homeassistant": "2024.6.0", + "homeassistant": "2024.6.4", "hacs": "1.34.0", "filename": "ecotrend_ista.zip" } \ No newline at end of file From 3bac1471e3df680fbfaae5c003b09a625c7251c1 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sun, 23 Jun 2024 22:08:56 +0200 Subject: [PATCH 8/8] Update config_flow.py --- custom_components/ecotrend_ista/config_flow.py | 1 - 1 file changed, 1 deletion(-) diff --git a/custom_components/ecotrend_ista/config_flow.py b/custom_components/ecotrend_ista/config_flow.py index 0dea856..44cd57d 100644 --- a/custom_components/ecotrend_ista/config_flow.py +++ b/custom_components/ecotrend_ista/config_flow.py @@ -31,7 +31,6 @@ def login_account(hass: core.HomeAssistant, data: MappingProxyType[str, Any], de email=data.get(CONF_EMAIL, None), password=data.get(CONF_PASSWORD, None), logger=_LOGGER, - # hass_dir=(hass.config.path("custom_components/ecotrend_ista") if demo else None), totp=data.get(CONF_MFA, "").replace(" ", ""), session=requests.Session(), )