Change AVM FRITZ!Box Call monitor sensor into an enum (#99762)

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
Jan Rieger 2023-09-07 15:26:57 +02:00 committed by GitHub
parent c9a1836d45
commit 0d6f202eb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -12,7 +12,7 @@ from typing import Any, cast
from fritzconnection.core.fritzmonitor import FritzMonitor 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.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP from homeassistant.const import CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import Event, HomeAssistant from homeassistant.core import Event, HomeAssistant
@ -82,6 +82,9 @@ class FritzBoxCallSensor(SensorEntity):
"""Implementation of a Fritz!Box call monitor.""" """Implementation of a Fritz!Box call monitor."""
_attr_icon = ICON_PHONE _attr_icon = ICON_PHONE
_attr_translation_key = DOMAIN
_attr_device_class = SensorDeviceClass.ENUM
_attr_options = list(CallState)
def __init__( def __init__(
self, self,

View File

@ -37,5 +37,17 @@
"error": { "error": {
"malformed_prefixes": "Prefixes are malformed, please check their format." "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%]"
}
}
}
} }
} }