Skip to content

Commit 02bb5d2

Browse files
committed
binary_sensor: add problem_type attribute to temperature_alert entity
1 parent 1ae755f commit 02bb5d2

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

custom_components/bhyve/binary_sensor.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ class BHyveBinarySensorEntityDescription(BinarySensorEntityDescription):
6363
value_fn=lambda data: (
6464
"alarm" in data.get("status", {}).get("temp_alarm_status", "")
6565
),
66-
attributes_fn=lambda data: (
67-
thresh
68-
if isinstance(thresh := data.get("temp_alarm_thresholds"), dict)
69-
else {}
70-
),
66+
attributes_fn=lambda data: {
67+
**(thresh if isinstance(thresh := data.get("temp_alarm_thresholds"), dict) else {}),
68+
"problem_type": "temperature",
69+
},
7170
),
7271
BHyveBinarySensorEntityDescription(
7372
key="fault",

0 commit comments

Comments
 (0)