mirror of
https://github.com/home-assistant/core
synced 2024-08-28 03:36:46 +02:00
Use walrus operator for roomba total cleaned area sensor value (#106772)
This commit is contained in:
parent
41f0eda712
commit
a64f912733
@ -126,9 +126,7 @@ SENSORS: list[RoombaSensorEntityDescription] = [
|
|||||||
native_unit_of_measurement=AREA_SQUARE_METERS,
|
native_unit_of_measurement=AREA_SQUARE_METERS,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
value_fn=lambda self: (
|
value_fn=lambda self: (
|
||||||
self.run_stats.get("sqft") * 9.29
|
None if (sqft := self.run_stats.get("sqft")) is None else sqft * 9.29
|
||||||
if self.run_stats.get("sqft") is not None
|
|
||||||
else None
|
|
||||||
),
|
),
|
||||||
suggested_display_precision=0,
|
suggested_display_precision=0,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
|
Loading…
Reference in New Issue
Block a user