Skip to content

Commit

Permalink
Fix some sensor configurations to be more precise (#4789)
Browse files Browse the repository at this point in the history
  • Loading branch information
dshokouhi authored Nov 7, 2024
1 parent db8e775 commit d926a7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class ActivitySensorManager : BroadcastReceiver(), SensorManager {
commonR.string.sensor_description_sleep_segment,
"mdi:sleep",
unitOfMeasurement = "ms",
deviceClass = "duration",
updateType = SensorManager.BasicSensor.UpdateType.CUSTOM
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class DisplaySensorManager : SensorManager {
commonR.string.sensor_name_screen_off_timeout,
commonR.string.sensor_description_screen_off_timeout,
"mdi:cellphone-off",
unitOfMeasurement = "ms",
deviceClass = "duration",
docsLink = "https://companion.home-assistant.io/docs/core/sensors#screen-off-timeout-sensor"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class HealthServicesSensorManager : SensorManager {
"mdi:stairs",
unitOfMeasurement = "floors",
entityCategory = SensorManager.ENTITY_CATEGORY_DIAGNOSTIC,
stateClass = SensorManager.STATE_CLASS_TOTAL_INCREASING,
updateType = SensorManager.BasicSensor.UpdateType.WORKER
)
private val dailyDistance = SensorManager.BasicSensor(
Expand All @@ -62,6 +63,7 @@ class HealthServicesSensorManager : SensorManager {
"distance",
unitOfMeasurement = "m",
entityCategory = SensorManager.ENTITY_CATEGORY_DIAGNOSTIC,
stateClass = SensorManager.STATE_CLASS_TOTAL_INCREASING,
updateType = SensorManager.BasicSensor.UpdateType.WORKER
)
private val dailyCalories = SensorManager.BasicSensor(
Expand All @@ -73,6 +75,7 @@ class HealthServicesSensorManager : SensorManager {
"energy",
unitOfMeasurement = "cal",
entityCategory = SensorManager.ENTITY_CATEGORY_DIAGNOSTIC,
stateClass = SensorManager.STATE_CLASS_TOTAL_INCREASING,
updateType = SensorManager.BasicSensor.UpdateType.WORKER
)
private val dailySteps = SensorManager.BasicSensor(
Expand All @@ -83,6 +86,7 @@ class HealthServicesSensorManager : SensorManager {
"mdi:shoe-print",
unitOfMeasurement = "steps",
entityCategory = SensorManager.ENTITY_CATEGORY_DIAGNOSTIC,
stateClass = SensorManager.STATE_CLASS_TOTAL_INCREASING,
updateType = SensorManager.BasicSensor.UpdateType.WORKER
)
}
Expand Down

0 comments on commit d926a7d

Please sign in to comment.