From 29dd886d2b869ecb98059a387306b319f9094859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Seux?= Date: Fri, 22 Nov 2024 18:21:47 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Rename=20default=20level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a recurring question from users, let's make it more explicit. Fix #82 --- custom_components/vigieau/__init__.py | 1 + custom_components/vigieau/api.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/vigieau/__init__.py b/custom_components/vigieau/__init__.py index 7f09f65..05ed2aa 100644 --- a/custom_components/vigieau/__init__.py +++ b/custom_components/vigieau/__init__.py @@ -258,6 +258,7 @@ def _handle_coordinator_update(self) -> None: self._attr_icon = { "vigilance": "mdi:water-check", + "vigilance (pas de restriction)": "mdi:water-check", "alerte": "mdi:water-alert", "alerte_renforcée": "mdi:water-remove", "alerte_renforcee": "mdi:water-remove", diff --git a/custom_components/vigieau/api.py b/custom_components/vigieau/api.py index edc9780..bf8ddbc 100644 --- a/custom_components/vigieau/api.py +++ b/custom_components/vigieau/api.py @@ -123,10 +123,10 @@ async def get_data( and re.match("Aucune zone.+en vigueur", (await resp.json())["message"]) ): _LOGGER.debug(f"Vigieau replied with no restriction, faking data") - data = {"niveauGravite": "vigilance", "usages": [], "arrete": {}} + data = {"niveauGravite": "vigilance (pas de restriction)", "usages": [], "arrete": {}} elif resp.status == 200 and (await resp.text()) == "": _LOGGER.debug(f"Vigieau replied with no data at all, faking data") - data = {"niveauGravite": "vigilance", "usages": [], "arrete": {}} + data = {"niveauGravite": "vigilance (pas de restriction)", "usages": [], "arrete": {}} elif resp.status in range(200, 300): data = await resp.json() else: