Add Phone Modem call reject button (#66742)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
8befb3b905
commit
eb80abf89e
4 changed files with 58 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
|||
"""A sensor for incoming calls using a USB modem that supports caller ID."""
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
from phone_modem import PhoneModem
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
|
@ -11,6 +13,8 @@ from homeassistant.helpers import entity_platform
|
|||
|
||||
from .const import CID, DATA_KEY_API, DOMAIN, ICON, SERVICE_REJECT_CALL
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
|
@ -42,6 +46,11 @@ async def async_setup_entry(
|
|||
platform = entity_platform.async_get_current_platform()
|
||||
|
||||
platform.async_register_entity_service(SERVICE_REJECT_CALL, {}, "async_reject_call")
|
||||
_LOGGER.warning(
|
||||
"Calling reject_call service is deprecated and will be removed after 2022.4; "
|
||||
"A new button entity is now available with the same function "
|
||||
"and replaces the existing service"
|
||||
)
|
||||
|
||||
|
||||
class ModemCalleridSensor(SensorEntity):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue