Fix total coffees sensor for lamarzocco (#135283)
parent
c4f8de8fd9
commit
2c3cd6e119
|
@ -3,7 +3,7 @@
|
|||
from collections.abc import Callable
|
||||
from dataclasses import dataclass
|
||||
|
||||
from pylamarzocco.const import BoilerType, MachineModel, PhysicalKey
|
||||
from pylamarzocco.const import BoilerType, MachineModel
|
||||
from pylamarzocco.devices.machine import LaMarzoccoMachine
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
|
@ -81,7 +81,7 @@ STATISTIC_ENTITIES: tuple[LaMarzoccoSensorEntityDescription, ...] = (
|
|||
translation_key="drink_stats_coffee",
|
||||
native_unit_of_measurement="drinks",
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
value_fn=lambda device: device.statistics.drink_stats.get(PhysicalKey.A, 0),
|
||||
value_fn=lambda device: device.statistics.total_coffee,
|
||||
available_fn=lambda device: len(device.statistics.drink_stats) > 0,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
|
|
|
@ -256,7 +256,7 @@
|
|||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '1047',
|
||||
'state': '2387',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.gs012345_total_flushes_made-entry]
|
||||
|
|
Loading…
Reference in New Issue