Skip to content

Commit

Permalink
improve handling of incorrect values in fyta integration (#115134)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
2 people authored and frenck committed Apr 8, 2024
1 parent 19f3ef7 commit 7bea6ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions homeassistant/components/fyta/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,35 +46,35 @@ class FytaSensorEntityDescription(SensorEntityDescription):
translation_key="plant_status",
device_class=SensorDeviceClass.ENUM,
options=PLANT_STATUS_LIST,
value_fn=lambda value: PLANT_STATUS[value],
value_fn=PLANT_STATUS.get,
),
FytaSensorEntityDescription(
key="temperature_status",
translation_key="temperature_status",
device_class=SensorDeviceClass.ENUM,
options=PLANT_STATUS_LIST,
value_fn=lambda value: PLANT_STATUS[value],
value_fn=PLANT_STATUS.get,
),
FytaSensorEntityDescription(
key="light_status",
translation_key="light_status",
device_class=SensorDeviceClass.ENUM,
options=PLANT_STATUS_LIST,
value_fn=lambda value: PLANT_STATUS[value],
value_fn=PLANT_STATUS.get,
),
FytaSensorEntityDescription(
key="moisture_status",
translation_key="moisture_status",
device_class=SensorDeviceClass.ENUM,
options=PLANT_STATUS_LIST,
value_fn=lambda value: PLANT_STATUS[value],
value_fn=PLANT_STATUS.get,
),
FytaSensorEntityDescription(
key="salinity_status",
translation_key="salinity_status",
device_class=SensorDeviceClass.ENUM,
options=PLANT_STATUS_LIST,
value_fn=lambda value: PLANT_STATUS[value],
value_fn=PLANT_STATUS.get,
),
FytaSensorEntityDescription(
key="temperature",
Expand Down

0 comments on commit 7bea6ef

Please sign in to comment.