mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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:
parent
c9a1836d45
commit
0d6f202eb3
@ -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,
|
||||
|
@ -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%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user