Add Phone Modem call reject button (#66742)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Robert Hillis 2022-02-23 11:05:21 -05:00 committed by GitHub
parent 8befb3b905
commit eb80abf89e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 1 deletions

View file

@ -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):