Set icons for sent sensor values

This commit is contained in:
Klaas Winter
2024-08-05 19:34:26 +02:00
parent 700e7ca822
commit 43378bfe8c
2 changed files with 14 additions and 5 deletions

View File

@ -217,6 +217,7 @@ class WebhookManager {
"state" => System.getSystemStats().battery,
"type" => "sensor",
"unique_id" => "battery_level",
"icon" => "mdi:battery",
"unit_of_measurement" => "%",
"state_class" => "measurement",
"entity_category" => "diagnostic",
@ -228,6 +229,7 @@ class WebhookManager {
"state" => System.getSystemStats().charging,
"type" => "binary_sensor",
"unique_id" => "battery_is_charging",
"icon" => System.getSystemStats().charging ? "mdi:battery-plus" : "mdi:battery-minus",
"entity_category" => "diagnostic",
"disabled" => !Settings.isSensorsLevelEnabled()
},
@ -236,7 +238,7 @@ class WebhookManager {
"state" => activityInfo.steps == null ? "unknown" : activityInfo.steps,
"type" => "sensor",
"unique_id" => "steps_today",
"icon" => "mdi:shoe-print",
"icon" => "mdi:walk",
"state_class" => "total",
"disabled" => !Settings.isSensorsLevelEnabled()
},