mirror of
https://github.com/home-assistant/core.git
synced 2026-09-26 09:23:17 -04:00
Use glass break device class in HomematicIP Cloud (#182240)
Co-authored-by: Jonas Petersson <499325+catellie@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
co-authored by
Jonas Petersson
Codex
parent
c1ac51d9a3
commit
369a011b58
@@ -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."""
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user