From 369a011b58befa02a5930b28fe9c63f167d93ce0 Mon Sep 17 00:00:00 2001 From: Jonas Petersson Date: Sat, 19 Sep 2026 09:18:48 +0200 Subject: [PATCH] Use glass break device class in HomematicIP Cloud (#182240) Co-authored-by: Jonas Petersson <499325+catellie@users.noreply.github.com> Co-authored-by: Codex --- homeassistant/components/homematicip_cloud/binary_sensor.py | 2 +- tests/components/homematicip_cloud/test_binary_sensor.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/homematicip_cloud/binary_sensor.py b/homeassistant/components/homematicip_cloud/binary_sensor.py index 5fe9605f80c5..a4698c6e5d18 100644 --- a/homeassistant/components/homematicip_cloud/binary_sensor.py +++ b/homeassistant/components/homematicip_cloud/binary_sensor.py @@ -562,7 +562,7 @@ class HomematicipFullFlushLockControllerGlassBreak( ): """Representation of the HomematicIP full flush lock controller glass state.""" - _attr_device_class = BinarySensorDeviceClass.PROBLEM + _attr_device_class = BinarySensorDeviceClass.GLASS_BREAK def __init__(self, hap: HomematicipHAP, device) -> None: """Initialize the full flush lock controller glass break sensor.""" diff --git a/tests/components/homematicip_cloud/test_binary_sensor.py b/tests/components/homematicip_cloud/test_binary_sensor.py index ddf03a299dbd..5122063c6eea 100644 --- a/tests/components/homematicip_cloud/test_binary_sensor.py +++ b/tests/components/homematicip_cloud/test_binary_sensor.py @@ -10,6 +10,7 @@ from homematicip.base.enums import ( ) import pytest +from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.homematicip_cloud.binary_sensor import ( ATTR_ACCELERATION_SENSOR_MODE, ATTR_ACCELERATION_SENSOR_NEUTRAL_POSITION, @@ -30,7 +31,7 @@ from homeassistant.components.homematicip_cloud.entity import ( ATTR_RSSI_DEVICE, ATTR_SABOTAGE, ) -from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNKNOWN +from homeassistant.const import ATTR_DEVICE_CLASS, STATE_OFF, STATE_ON, STATE_UNKNOWN from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er @@ -69,6 +70,9 @@ async def test_hmip_full_flush_lock_controller_binary_sensors( "HmIP-FLC", ) assert glass_state.state == STATE_ON + assert ( + glass_state.attributes[ATTR_DEVICE_CLASS] == BinarySensorDeviceClass.GLASS_BREAK + ) assert hmip_device is not None await async_manipulate_test_data(hass, hmip_device, "lockState", "UNLOCKED")