Bump fyta_cli to 0.4.1 (#115918)

* bump fyta_cli to 0.4.0

* Update PLANT_STATUS and add PLANT_MEASUREMENT_STATUS

* bump fyta_cli to v0.4.0

* minor adjustments of states to API documentation
This commit is contained in:
dontinelli 2024-04-29 17:08:36 +02:00 committed by GitHub
parent 8bfcaf3524
commit 8ed10c7c4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 49 additions and 38 deletions

View file

@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/fyta", "documentation": "https://www.home-assistant.io/integrations/fyta",
"integration_type": "hub", "integration_type": "hub",
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"requirements": ["fyta_cli==0.3.5"] "requirements": ["fyta_cli==0.4.1"]
} }

View file

@ -7,7 +7,7 @@ from dataclasses import dataclass
from datetime import datetime from datetime import datetime
from typing import Final 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 ( from homeassistant.components.sensor import (
SensorDeviceClass, 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]] = [ SENSORS: Final[list[FytaSensorEntityDescription]] = [
FytaSensorEntityDescription( FytaSensorEntityDescription(
@ -52,29 +60,29 @@ SENSORS: Final[list[FytaSensorEntityDescription]] = [
key="temperature_status", key="temperature_status",
translation_key="temperature_status", translation_key="temperature_status",
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
options=PLANT_STATUS_LIST, options=PLANT_MEASUREMENT_STATUS_LIST,
value_fn=PLANT_STATUS.get, value_fn=PLANT_MEASUREMENT_STATUS.get,
), ),
FytaSensorEntityDescription( FytaSensorEntityDescription(
key="light_status", key="light_status",
translation_key="light_status", translation_key="light_status",
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
options=PLANT_STATUS_LIST, options=PLANT_MEASUREMENT_STATUS_LIST,
value_fn=PLANT_STATUS.get, value_fn=PLANT_MEASUREMENT_STATUS.get,
), ),
FytaSensorEntityDescription( FytaSensorEntityDescription(
key="moisture_status", key="moisture_status",
translation_key="moisture_status", translation_key="moisture_status",
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
options=PLANT_STATUS_LIST, options=PLANT_MEASUREMENT_STATUS_LIST,
value_fn=PLANT_STATUS.get, value_fn=PLANT_MEASUREMENT_STATUS.get,
), ),
FytaSensorEntityDescription( FytaSensorEntityDescription(
key="salinity_status", key="salinity_status",
translation_key="salinity_status", translation_key="salinity_status",
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
options=PLANT_STATUS_LIST, options=PLANT_MEASUREMENT_STATUS_LIST,
value_fn=PLANT_STATUS.get, value_fn=PLANT_MEASUREMENT_STATUS.get,
), ),
FytaSensorEntityDescription( FytaSensorEntityDescription(
key="temperature", key="temperature",

View file

@ -36,6 +36,16 @@
"plant_status": { "plant_status": {
"name": "Plant state", "name": "Plant state",
"state": { "state": {
"deleted": "Deleted",
"doing_great": "Doing great",
"need_attention": "Needs attention",
"no_sensor": "No sensor"
}
},
"temperature_status": {
"name": "Temperature state",
"state": {
"no_data": "No data",
"too_low": "Too low", "too_low": "Too low",
"low": "Low", "low": "Low",
"perfect": "Perfect", "perfect": "Perfect",
@ -43,44 +53,37 @@
"too_high": "Too high" "too_high": "Too high"
} }
}, },
"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%]"
}
},
"light_status": { "light_status": {
"name": "Light state", "name": "Light state",
"state": { "state": {
"too_low": "[%key:component::fyta::entity::sensor::plant_status::state::too_low%]", "no_data": "[%key:component::fyta::entity::sensor::temperature_status::state::no_data%]",
"low": "[%key:component::fyta::entity::sensor::plant_status::state::low%]", "too_low": "[%key:component::fyta::entity::sensor::temperature_status::state::too_low%]",
"perfect": "[%key:component::fyta::entity::sensor::plant_status::state::perfect%]", "low": "[%key:component::fyta::entity::sensor::temperature_status::state::low%]",
"high": "[%key:component::fyta::entity::sensor::plant_status::state::high%]", "perfect": "[%key:component::fyta::entity::sensor::temperature_status::state::perfect%]",
"too_high": "[%key:component::fyta::entity::sensor::plant_status::state::too_high%]" "high": "[%key:component::fyta::entity::sensor::temperature_status::state::high%]",
"too_high": "[%key:component::fyta::entity::sensor::temperature_status::state::too_high%]"
} }
}, },
"moisture_status": { "moisture_status": {
"name": "Moisture state", "name": "Moisture state",
"state": { "state": {
"too_low": "[%key:component::fyta::entity::sensor::plant_status::state::too_low%]", "no_data": "[%key:component::fyta::entity::sensor::temperature_status::state::no_data%]",
"low": "[%key:component::fyta::entity::sensor::plant_status::state::low%]", "too_low": "[%key:component::fyta::entity::sensor::temperature_status::state::too_low%]",
"perfect": "[%key:component::fyta::entity::sensor::plant_status::state::perfect%]", "low": "[%key:component::fyta::entity::sensor::temperature_status::state::low%]",
"high": "[%key:component::fyta::entity::sensor::plant_status::state::high%]", "perfect": "[%key:component::fyta::entity::sensor::temperature_status::state::perfect%]",
"too_high": "[%key:component::fyta::entity::sensor::plant_status::state::too_high%]" "high": "[%key:component::fyta::entity::sensor::temperature_status::state::high%]",
"too_high": "[%key:component::fyta::entity::sensor::temperature_status::state::too_high%]"
} }
}, },
"salinity_status": { "salinity_status": {
"name": "Salinity state", "name": "Salinity state",
"state": { "state": {
"too_low": "[%key:component::fyta::entity::sensor::plant_status::state::too_low%]", "no_data": "[%key:component::fyta::entity::sensor::temperature_status::state::no_data%]",
"low": "[%key:component::fyta::entity::sensor::plant_status::state::low%]", "too_low": "[%key:component::fyta::entity::sensor::temperature_status::state::too_low%]",
"perfect": "[%key:component::fyta::entity::sensor::plant_status::state::perfect%]", "low": "[%key:component::fyta::entity::sensor::temperature_status::state::low%]",
"high": "[%key:component::fyta::entity::sensor::plant_status::state::high%]", "perfect": "[%key:component::fyta::entity::sensor::temperature_status::state::perfect%]",
"too_high": "[%key:component::fyta::entity::sensor::plant_status::state::too_high%]" "high": "[%key:component::fyta::entity::sensor::temperature_status::state::high%]",
"too_high": "[%key:component::fyta::entity::sensor::temperature_status::state::too_high%]"
} }
}, },
"light": { "light": {

View file

@ -900,7 +900,7 @@ freesms==0.2.0
fritzconnection[qr]==1.13.2 fritzconnection[qr]==1.13.2
# homeassistant.components.fyta # homeassistant.components.fyta
fyta_cli==0.3.5 fyta_cli==0.4.1
# homeassistant.components.google_translate # homeassistant.components.google_translate
gTTS==2.2.4 gTTS==2.2.4

View file

@ -735,7 +735,7 @@ freebox-api==1.1.0
fritzconnection[qr]==1.13.2 fritzconnection[qr]==1.13.2
# homeassistant.components.fyta # homeassistant.components.fyta
fyta_cli==0.3.5 fyta_cli==0.4.1
# homeassistant.components.google_translate # homeassistant.components.google_translate
gTTS==2.2.4 gTTS==2.2.4