2020-08-05 00:43:35 -10:00
|
|
|
"""Tracks devices by sending a ICMP echo request (ping)."""
|
|
|
|
|
2022-08-18 10:22:49 +02:00
|
|
|
from homeassistant.const import Platform
|
|
|
|
|
2021-03-31 03:06:49 -10:00
|
|
|
# The ping binary and icmplib timeouts are not the same
|
|
|
|
# timeout. ping is an overall timeout, icmplib is the
|
|
|
|
# time since the data was sent.
|
|
|
|
|
|
|
|
# ping binary
|
2020-08-05 00:43:35 -10:00
|
|
|
PING_TIMEOUT = 3
|
2021-03-31 03:06:49 -10:00
|
|
|
|
|
|
|
# icmplib timeout
|
|
|
|
ICMP_TIMEOUT = 1
|
|
|
|
|
2020-08-28 08:50:09 -05:00
|
|
|
PING_ATTEMPTS_COUNT = 3
|
2021-03-31 03:06:49 -10:00
|
|
|
|
|
|
|
DOMAIN = "ping"
|
2022-08-18 10:22:49 +02:00
|
|
|
PLATFORMS = [Platform.BINARY_SENSOR]
|
2021-03-31 03:06:49 -10:00
|
|
|
|
|
|
|
PING_PRIVS = "ping_privs"
|