Add total cycles sensor for Litter-Robot (#147435)

* Add total cycles sensor for Litter-Robot

* Add translatable unit of measurement cycles
This commit is contained in:
Nathan Spencer
2025-06-24 10:24:15 -06:00
committed by GitHub
parent 657a068087
commit 54e5107c34
4 changed files with 24 additions and 1 deletions

View File

@@ -46,6 +46,9 @@
"motor_fault_short": "mdi:flash-off",
"motor_ot_amps": "mdi:flash-alert"
}
},
"total_cycles": {
"default": "mdi:counter"
}
},
"switch": {

View File

@@ -115,6 +115,14 @@ ROBOT_SENSOR_MAP: dict[type[Robot], list[RobotSensorEntityDescription]] = {
lambda robot: status.lower() if (status := robot.status_code) else None
),
),
RobotSensorEntityDescription[LitterRobot](
key="total_cycles",
translation_key="total_cycles",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
state_class=SensorStateClass.TOTAL_INCREASING,
value_fn=lambda robot: robot.cycle_count,
),
],
LitterRobot4: [
RobotSensorEntityDescription[LitterRobot4](

View File

@@ -118,6 +118,10 @@
"spf": "Pinch detect at startup"
}
},
"total_cycles": {
"name": "Total cycles",
"unit_of_measurement": "cycles"
},
"waste_drawer": {
"name": "Waste drawer"
}