diff --git a/homeassistant/components/fyta/manifest.json b/homeassistant/components/fyta/manifest.json index 55255777994d751edc81a36c5afaf6a43a0d3552..020ab330152c3bec4cbc588871ddac5788ccd360 100644 --- a/homeassistant/components/fyta/manifest.json +++ b/homeassistant/components/fyta/manifest.json @@ -6,5 +6,5 @@ "documentation": "https://www.home-assistant.io/integrations/fyta", "integration_type": "hub", "iot_class": "cloud_polling", - "requirements": ["fyta_cli==0.3.5"] + "requirements": ["fyta_cli==0.4.1"] } diff --git a/homeassistant/components/fyta/sensor.py b/homeassistant/components/fyta/sensor.py index 2b9e8e3de07675bb76b02a3b25781bc6ed9e45bf..c3e90cef28ee32300df1a42b41f6f2e2c99bfb9d 100644 --- a/homeassistant/components/fyta/sensor.py +++ b/homeassistant/components/fyta/sensor.py @@ -7,7 +7,7 @@ from dataclasses import dataclass from datetime import datetime from typing import Final -from fyta_cli.fyta_connector import PLANT_STATUS +from fyta_cli.fyta_connector import PLANT_MEASUREMENT_STATUS, PLANT_STATUS from homeassistant.components.sensor import ( SensorDeviceClass, @@ -34,7 +34,15 @@ class FytaSensorEntityDescription(SensorEntityDescription): ) -PLANT_STATUS_LIST: list[str] = ["too_low", "low", "perfect", "high", "too_high"] +PLANT_STATUS_LIST: list[str] = ["deleted", "doing_great", "need_attention", "no_sensor"] +PLANT_MEASUREMENT_STATUS_LIST: list[str] = [ + "no_data", + "too_low", + "low", + "perfect", + "high", + "too_high", +] SENSORS: Final[list[FytaSensorEntityDescription]] = [ FytaSensorEntityDescription( @@ -52,29 +60,29 @@ SENSORS: Final[list[FytaSensorEntityDescription]] = [ key="temperature_status", translation_key="temperature_status", device_class=SensorDeviceClass.ENUM, - options=PLANT_STATUS_LIST, - value_fn=PLANT_STATUS.get, + options=PLANT_MEASUREMENT_STATUS_LIST, + value_fn=PLANT_MEASUREMENT_STATUS.get, ), FytaSensorEntityDescription( key="light_status", translation_key="light_status", device_class=SensorDeviceClass.ENUM, - options=PLANT_STATUS_LIST, - value_fn=PLANT_STATUS.get, + options=PLANT_MEASUREMENT_STATUS_LIST, + value_fn=PLANT_MEASUREMENT_STATUS.get, ), FytaSensorEntityDescription( key="moisture_status", translation_key="moisture_status", device_class=SensorDeviceClass.ENUM, - options=PLANT_STATUS_LIST, - value_fn=PLANT_STATUS.get, + options=PLANT_MEASUREMENT_STATUS_LIST, + value_fn=PLANT_MEASUREMENT_STATUS.get, ), FytaSensorEntityDescription( key="salinity_status", translation_key="salinity_status", device_class=SensorDeviceClass.ENUM, - options=PLANT_STATUS_LIST, - value_fn=PLANT_STATUS.get, + options=PLANT_MEASUREMENT_STATUS_LIST, + value_fn=PLANT_MEASUREMENT_STATUS.get, ), FytaSensorEntityDescription( key="temperature", diff --git a/homeassistant/components/fyta/strings.json b/homeassistant/components/fyta/strings.json index 3df851489bcd8122bd3363b3e1f73f74f3e2d11e..bacd24555b08bc71b8053bb15d7ac0c8ca296eb6 100644 --- a/homeassistant/components/fyta/strings.json +++ b/homeassistant/components/fyta/strings.json @@ -36,51 +36,54 @@ "plant_status": { "name": "Plant state", "state": { - "too_low": "Too low", - "low": "Low", - "perfect": "Perfect", - "high": "High", - "too_high": "Too high" + "deleted": "Deleted", + "doing_great": "Doing great", + "need_attention": "Needs attention", + "no_sensor": "No sensor" } }, "temperature_status": { "name": "Temperature state", "state": { - "too_low": "[%key:component::fyta::entity::sensor::plant_status::state::too_low%]", - "low": "[%key:component::fyta::entity::sensor::plant_status::state::low%]", - "perfect": "[%key:component::fyta::entity::sensor::plant_status::state::perfect%]", - "high": "[%key:component::fyta::entity::sensor::plant_status::state::high%]", - "too_high": "[%key:component::fyta::entity::sensor::plant_status::state::too_high%]" + "no_data": "No data", + "too_low": "Too low", + "low": "Low", + "perfect": "Perfect", + "high": "High", + "too_high": "Too high" } }, "light_status": { "name": "Light state", "state": { - "too_low": "[%key:component::fyta::entity::sensor::plant_status::state::too_low%]", - "low": "[%key:component::fyta::entity::sensor::plant_status::state::low%]", - "perfect": "[%key:component::fyta::entity::sensor::plant_status::state::perfect%]", - "high": "[%key:component::fyta::entity::sensor::plant_status::state::high%]", - "too_high": "[%key:component::fyta::entity::sensor::plant_status::state::too_high%]" + "no_data": "[%key:component::fyta::entity::sensor::temperature_status::state::no_data%]", + "too_low": "[%key:component::fyta::entity::sensor::temperature_status::state::too_low%]", + "low": "[%key:component::fyta::entity::sensor::temperature_status::state::low%]", + "perfect": "[%key:component::fyta::entity::sensor::temperature_status::state::perfect%]", + "high": "[%key:component::fyta::entity::sensor::temperature_status::state::high%]", + "too_high": "[%key:component::fyta::entity::sensor::temperature_status::state::too_high%]" } }, "moisture_status": { "name": "Moisture state", "state": { - "too_low": "[%key:component::fyta::entity::sensor::plant_status::state::too_low%]", - "low": "[%key:component::fyta::entity::sensor::plant_status::state::low%]", - "perfect": "[%key:component::fyta::entity::sensor::plant_status::state::perfect%]", - "high": "[%key:component::fyta::entity::sensor::plant_status::state::high%]", - "too_high": "[%key:component::fyta::entity::sensor::plant_status::state::too_high%]" + "no_data": "[%key:component::fyta::entity::sensor::temperature_status::state::no_data%]", + "too_low": "[%key:component::fyta::entity::sensor::temperature_status::state::too_low%]", + "low": "[%key:component::fyta::entity::sensor::temperature_status::state::low%]", + "perfect": "[%key:component::fyta::entity::sensor::temperature_status::state::perfect%]", + "high": "[%key:component::fyta::entity::sensor::temperature_status::state::high%]", + "too_high": "[%key:component::fyta::entity::sensor::temperature_status::state::too_high%]" } }, "salinity_status": { "name": "Salinity state", "state": { - "too_low": "[%key:component::fyta::entity::sensor::plant_status::state::too_low%]", - "low": "[%key:component::fyta::entity::sensor::plant_status::state::low%]", - "perfect": "[%key:component::fyta::entity::sensor::plant_status::state::perfect%]", - "high": "[%key:component::fyta::entity::sensor::plant_status::state::high%]", - "too_high": "[%key:component::fyta::entity::sensor::plant_status::state::too_high%]" + "no_data": "[%key:component::fyta::entity::sensor::temperature_status::state::no_data%]", + "too_low": "[%key:component::fyta::entity::sensor::temperature_status::state::too_low%]", + "low": "[%key:component::fyta::entity::sensor::temperature_status::state::low%]", + "perfect": "[%key:component::fyta::entity::sensor::temperature_status::state::perfect%]", + "high": "[%key:component::fyta::entity::sensor::temperature_status::state::high%]", + "too_high": "[%key:component::fyta::entity::sensor::temperature_status::state::too_high%]" } }, "light": { diff --git a/requirements_all.txt b/requirements_all.txt index 551d6ae475537b67050d28d5b9f1b63fc8155050..cbc4144ef2650a20bc52c1d57535bde0c30a40aa 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -900,7 +900,7 @@ freesms==0.2.0 fritzconnection[qr]==1.13.2 # homeassistant.components.fyta -fyta_cli==0.3.5 +fyta_cli==0.4.1 # homeassistant.components.google_translate gTTS==2.2.4 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 5faa35b01dc28b2f918a6445d65ca8599eff5897..5b0e2ce337302ec6342401d80bca3513e7111113 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -735,7 +735,7 @@ freebox-api==1.1.0 fritzconnection[qr]==1.13.2 # homeassistant.components.fyta -fyta_cli==0.3.5 +fyta_cli==0.4.1 # homeassistant.components.google_translate gTTS==2.2.4