From 0d6f202eb34e923d0cbdec443a21f4b28891ad63 Mon Sep 17 00:00:00 2001 From: Jan Rieger Date: Thu, 7 Sep 2023 15:26:57 +0200 Subject: [PATCH] Change AVM FRITZ!Box Call monitor sensor into an enum (#99762) Co-authored-by: Joost Lekkerkerker Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- .../components/fritzbox_callmonitor/sensor.py | 5 ++++- .../components/fritzbox_callmonitor/strings.json | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/fritzbox_callmonitor/sensor.py b/homeassistant/components/fritzbox_callmonitor/sensor.py index 43cdb29f85f..11c3166fd88 100644 --- a/homeassistant/components/fritzbox_callmonitor/sensor.py +++ b/homeassistant/components/fritzbox_callmonitor/sensor.py @@ -12,7 +12,7 @@ from typing import Any, cast from fritzconnection.core.fritzmonitor import FritzMonitor -from homeassistant.components.sensor import SensorEntity +from homeassistant.components.sensor import SensorDeviceClass, SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP from homeassistant.core import Event, HomeAssistant @@ -82,6 +82,9 @@ class FritzBoxCallSensor(SensorEntity): """Implementation of a Fritz!Box call monitor.""" _attr_icon = ICON_PHONE + _attr_translation_key = DOMAIN + _attr_device_class = SensorDeviceClass.ENUM + _attr_options = list(CallState) def __init__( self, diff --git a/homeassistant/components/fritzbox_callmonitor/strings.json b/homeassistant/components/fritzbox_callmonitor/strings.json index 6b2fa2943f9..89f049bfbe9 100644 --- a/homeassistant/components/fritzbox_callmonitor/strings.json +++ b/homeassistant/components/fritzbox_callmonitor/strings.json @@ -37,5 +37,17 @@ "error": { "malformed_prefixes": "Prefixes are malformed, please check their format." } + }, + "entity": { + "sensor": { + "fritzbox_callmonitor": { + "state": { + "ringing": "Ringing", + "dialing": "Dialing", + "talking": "Talking", + "idle": "[%key:common::state::idle%]" + } + } + } } }