* Add phone_modem integration * Use original domain * Add init tests for Modem Caller ID * Clean up tests * Clean up tests * apply suggestions * Fix tests * Make only one instance possible * Allow more than 1 device and remove hangup service * simplify already configured * Update sensor.py * Update config_flow.py * Fix manifest * More cleanup * Fix tests * Ue target * Clean up sensor.py * Minor tweaks * Close modem on restart and unload * Update requirements * fix tests * Bump phone_modem * rework * add typing * use async_setup_platform * typing * tweak * cleanup * fix init * preserve original name * remove callback line * use list of serial devices on host * tweak * rework * Rework for usb dicsovery * Update requirements_test_all.txt * Update config_flow.py * tweaks * tweak * move api out of try statement * suggested tweaks * clean up * typing * tweak * tweak * async name the service
27 lines
575 B
Python
27 lines
575 B
Python
"""Constants for the Modem Caller ID integration."""
|
|
from typing import Final
|
|
|
|
from phone_modem import exceptions
|
|
from serial import SerialException
|
|
|
|
DATA_KEY_API = "api"
|
|
DATA_KEY_COORDINATOR = "coordinator"
|
|
DEFAULT_NAME = "Phone Modem"
|
|
DOMAIN = "modem_callerid"
|
|
ICON = "mdi:phone-classic"
|
|
SERVICE_REJECT_CALL = "reject_call"
|
|
|
|
EXCEPTIONS: Final = (
|
|
FileNotFoundError,
|
|
exceptions.SerialError,
|
|
exceptions.ResponseError,
|
|
SerialException,
|
|
)
|
|
|
|
|
|
class CID:
|
|
"""CID Attributes."""
|
|
|
|
CID_TIME = "cid_time"
|
|
CID_NUMBER = "cid_number"
|
|
CID_NAME = "cid_name"
|