From 4dd3abb16a6605865d5ee7b2e58813a269b9a256 Mon Sep 17 00:00:00 2001 From: Raphael Hehl <7577984+RaHehl@users.noreply.github.com> Date: Thu, 18 Dec 2025 14:43:44 +0100 Subject: [PATCH] Fix device classes in unifiprotect integration (#159281) Co-authored-by: RaHehl --- homeassistant/components/unifiprotect/binary_sensor.py | 1 + homeassistant/components/unifiprotect/button.py | 6 +----- homeassistant/components/unifiprotect/services.yaml | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/unifiprotect/binary_sensor.py b/homeassistant/components/unifiprotect/binary_sensor.py index da292e805bf..d288fe66e2b 100644 --- a/homeassistant/components/unifiprotect/binary_sensor.py +++ b/homeassistant/components/unifiprotect/binary_sensor.py @@ -453,6 +453,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = ( ProtectBinaryEventEntityDescription( key="smart_audio_cmonx", translation_key="co_alarm_detected", + device_class=BinarySensorDeviceClass.CO, ufp_required_field="can_detect_co", ufp_enabled="is_co_detection_on", ufp_event_obj="last_cmonx_detect_event", diff --git a/homeassistant/components/unifiprotect/button.py b/homeassistant/components/unifiprotect/button.py index 942da255a4e..67356fcf862 100644 --- a/homeassistant/components/unifiprotect/button.py +++ b/homeassistant/components/unifiprotect/button.py @@ -6,7 +6,7 @@ from collections.abc import Sequence from dataclasses import dataclass from functools import partial import logging -from typing import TYPE_CHECKING, Final +from typing import TYPE_CHECKING from uiprotect.data import ModelType, ProtectAdoptableDeviceModel @@ -45,9 +45,6 @@ class ProtectButtonEntityDescription( ufp_press: str | None = None -DEVICE_CLASS_CHIME_BUTTON: Final = "unifiprotect__chime_button" - - ALL_DEVICE_BUTTONS: tuple[ProtectButtonEntityDescription, ...] = ( ProtectButtonEntityDescription( key="reboot", @@ -84,7 +81,6 @@ CHIME_BUTTONS: tuple[ProtectButtonEntityDescription, ...] = ( ProtectButtonEntityDescription( key="play", translation_key="play_chime", - device_class=DEVICE_CLASS_CHIME_BUTTON, ufp_press="play", ), ProtectButtonEntityDescription( diff --git a/homeassistant/components/unifiprotect/services.yaml b/homeassistant/components/unifiprotect/services.yaml index b620c195fc2..57d32e24993 100644 --- a/homeassistant/components/unifiprotect/services.yaml +++ b/homeassistant/components/unifiprotect/services.yaml @@ -29,8 +29,6 @@ set_chime_paired_doorbells: selector: device: integration: unifiprotect - entity: - device_class: unifiprotect__chime_button doorbells: example: "binary_sensor.front_doorbell_doorbell" required: false