Fix Watergate Water meter volume sensor (#133606)

This commit is contained in:
adam-the-hero 2024-12-19 20:25:24 +01:00 committed by GitHub
parent e6ef3fe507
commit 2413fc4c0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ class WatergateSensorEntityDescription(SensorEntityDescription):
DESCRIPTIONS: list[WatergateSensorEntityDescription] = [ DESCRIPTIONS: list[WatergateSensorEntityDescription] = [
WatergateSensorEntityDescription( WatergateSensorEntityDescription(
value_fn=lambda data: ( value_fn=lambda data: (
data.state.water_meter.duration data.state.water_meter.volume
if data.state and data.state.water_meter if data.state and data.state.water_meter
else None else None
), ),

View File

@ -352,7 +352,7 @@
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': '100', 'state': '1.2',
}) })
# --- # ---
# name: test_sensor[sensor.sonic_water_pressure-entry] # name: test_sensor[sensor.sonic_water_pressure-entry]