1 """DataUpdateCoordinators for the sms integration."""
4 from datetime
import timedelta
11 from .const
import DEFAULT_SCAN_INTERVAL
13 _LOGGER = logging.getLogger(__name__)
17 """Signal strength coordinator."""
20 """Initialize signal strength coordinator."""
24 name=
"Device signal state",
25 update_interval=
timedelta(seconds=DEFAULT_SCAN_INTERVAL),
30 """Fetch device signal quality."""
32 async
with asyncio.timeout(10):
33 return await self.
_gateway_gateway.get_signal_quality_async()
34 except gammu.GSMError
as exc:
35 raise UpdateFailed(f
"Error communicating with device: {exc}")
from exc
39 """Network info coordinator."""
42 """Initialize network info coordinator."""
46 name=
"Device network state",
47 update_interval=
timedelta(seconds=DEFAULT_SCAN_INTERVAL),
52 """Fetch device network info."""
54 async
with asyncio.timeout(10):
55 return await self.
_gateway_gateway.get_network_info_async()
56 except gammu.GSMError
as exc:
57 raise UpdateFailed(f
"Error communicating with device: {exc}")
from exc
def __init__(self, hass, gateway)
def _async_update_data(self)
def __init__(self, hass, gateway)
def _async_update_data(self)