From 4ad6d736bbc41788a7b2bd2997627c1023cec681 Mon Sep 17 00:00:00 2001 From: kugan49 Date: Mon, 30 Sep 2024 13:42:06 +0200 Subject: [PATCH] Release: v1.3.1 --- .github/workflows/push-pull.yaml | 2 +- .vscode/settings.json | 61 ++++++++++++-------------- CHANGELOG.md | 7 +++ custom_components/veolia/__init__.py | 7 +-- custom_components/veolia/entity.py | 5 ++- custom_components/veolia/manifest.json | 12 +++-- requirements_test.txt | 2 +- 7 files changed, 51 insertions(+), 45 deletions(-) diff --git a/.github/workflows/push-pull.yaml b/.github/workflows/push-pull.yaml index 1905573..7c510a8 100644 --- a/.github/workflows/push-pull.yaml +++ b/.github/workflows/push-pull.yaml @@ -30,7 +30,7 @@ jobs: name: Check style formatting steps: - uses: "actions/checkout@v4" - - uses: "actions/setup-python@v4" + - uses: "actions/setup-python@v5" with: python-version: "3.x" - run: python3 -m pip install black diff --git a/.vscode/settings.json b/.vscode/settings.json index 841c5b7..7d342e7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,34 +1,31 @@ { - "editor.formatOnPaste": false, - "editor.formatOnSave": true, - "python.formatting.provider": "black", - "python.formatting.blackArgs": [ - "--line-length", - "120" - ], - "python.linting.lintOnSave": true, - "python.linting.enabled": true, - "python.linting.pylintEnabled": false, - "python.linting.pylintPath": ".venv\\Scripts\\pylint", - "python.linting.pylintArgs": [ - "--load-plugins", - "--enable=W0614", - "--enable= W0611" - ], - "[python]": { - "editor.tabSize": 4, - "editor.codeActionsOnSave": { - "source.organizeImports": true - } - }, - "files.exclude": { - ".venv": true, - "**/__pycache__": true, - }, - "python.linting.flake8Enabled": true, - "python.analysis.typeCheckingMode": "off", - "todo-tree.tree.scanMode": "workspace", - "files.associations": { - "*.yaml": "home-assistant" + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "python.formatting.provider": "black", + "python.formatting.blackArgs": ["--line-length", "120"], + "python.linting.lintOnSave": true, + "python.linting.enabled": true, + "python.linting.pylintEnabled": false, + "python.linting.pylintPath": ".venv\\Scripts\\pylint", + "python.linting.pylintArgs": [ + "--load-plugins", + "--enable=W0614", + "--enable= W0611" + ], + "[python]": { + "editor.tabSize": 4, + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit" } -} \ No newline at end of file + }, + "files.exclude": { + ".venv": true, + "**/__pycache__": true + }, + "python.linting.flake8Enabled": true, + "python.analysis.typeCheckingMode": "off", + "todo-tree.tree.scanMode": "workspace", + "files.associations": { + "*.yaml": "home-assistant" + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index b6e82e0..3222b5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## v1.3.1 + +### Changed + +- Mise à jour des dépendances +- Mise à jour fonctions dépréciées par home assistant + ## v1.3.0 ### Changed diff --git a/custom_components/veolia/__init__.py b/custom_components/veolia/__init__.py index c0b675e..0a9fba3 100644 --- a/custom_components/veolia/__init__.py +++ b/custom_components/veolia/__init__.py @@ -1,6 +1,7 @@ """ Custom integration to integrate Veolia with Home Assistant. """ + import asyncio from datetime import timedelta import logging @@ -46,12 +47,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): hass.data[DOMAIN][entry.entry_id] = coordinator - for platform in PLATFORMS: - if entry.options.get(platform, True): - coordinator.platforms.append(platform) - hass.async_add_job(hass.config_entries.async_forward_entry_setup(entry, platform)) + await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) - entry.async_on_unload(entry.add_update_listener(async_reload_entry)) return True diff --git a/custom_components/veolia/entity.py b/custom_components/veolia/entity.py index 8b2230e..ce083fe 100644 --- a/custom_components/veolia/entity.py +++ b/custom_components/veolia/entity.py @@ -1,6 +1,7 @@ """VeoliaEntity class.""" + from homeassistant.components.sensor import SensorDeviceClass, SensorEntity -from homeassistant.const import VOLUME_LITERS +from homeassistant.const import UnitOfVolume from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import ATTRIBUTION, DAILY, DOMAIN, HISTORY, ICON, NAME @@ -40,7 +41,7 @@ def device_class(self): @property def unit_of_measurement(self): """Return the unit_of_measurement of the sensor.""" - return VOLUME_LITERS + return UnitOfVolume.LITERS @property def icon(self): diff --git a/custom_components/veolia/manifest.json b/custom_components/veolia/manifest.json index a11fd5b..2914a33 100644 --- a/custom_components/veolia/manifest.json +++ b/custom_components/veolia/manifest.json @@ -1,13 +1,17 @@ { "domain": "veolia", "name": "Veolia", - "codeowners": ["@kugan49"], + "codeowners": [ + "@kugan49" + ], "config_flow": true, "dependencies": [], "documentation": "https://github.com/kugan49/veolia-custom-component-HACS", "integration_type": "device", "iot_class": "cloud_polling", "issue_tracker": "https://github.com/kugan49/veolia-custom-component-HACS/issues", - "requirements": ["xmltodict==0.13.0"], - "version": "1.3.0" -} + "requirements": [ + "xmltodict==0.13.0" + ], + "version": "1.3.1" +} \ No newline at end of file diff --git a/requirements_test.txt b/requirements_test.txt index ebb2907..00ccf11 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1 +1 @@ -pytest-homeassistant-custom-component==0.13.57 +pytest-homeassistant-custom-component==0.13.88