mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
improve handling of incorrect values in fyta integration (#115134)
* improve handling of incorrect values * Changes based on review comment * Apply suggestions from code review Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * update value_fn * ruff --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
parent
9ec4e9a1a9
commit
80ec9d4394
@ -46,35 +46,35 @@ SENSORS: Final[list[FytaSensorEntityDescription]] = [
|
|||||||
translation_key="plant_status",
|
translation_key="plant_status",
|
||||||
device_class=SensorDeviceClass.ENUM,
|
device_class=SensorDeviceClass.ENUM,
|
||||||
options=PLANT_STATUS_LIST,
|
options=PLANT_STATUS_LIST,
|
||||||
value_fn=lambda value: PLANT_STATUS[value],
|
value_fn=PLANT_STATUS.get,
|
||||||
),
|
),
|
||||||
FytaSensorEntityDescription(
|
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_STATUS_LIST,
|
||||||
value_fn=lambda value: PLANT_STATUS[value],
|
value_fn=PLANT_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_STATUS_LIST,
|
||||||
value_fn=lambda value: PLANT_STATUS[value],
|
value_fn=PLANT_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_STATUS_LIST,
|
||||||
value_fn=lambda value: PLANT_STATUS[value],
|
value_fn=PLANT_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_STATUS_LIST,
|
||||||
value_fn=lambda value: PLANT_STATUS[value],
|
value_fn=PLANT_STATUS.get,
|
||||||
),
|
),
|
||||||
FytaSensorEntityDescription(
|
FytaSensorEntityDescription(
|
||||||
key="temperature",
|
key="temperature",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user