mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-08-03 09:24:31 +02:00
switched to standard ping
This commit is contained in:
parent
919c5022e8
commit
5aa6652301
1 changed files with 4 additions and 2 deletions
|
@ -435,7 +435,7 @@ class MikrotikAPI:
|
|||
return False
|
||||
|
||||
args = {
|
||||
"arp-ping": "yes",
|
||||
"arp-ping": "no",
|
||||
"interval": "100ms",
|
||||
"count": 3,
|
||||
"interface": interface,
|
||||
|
@ -443,7 +443,7 @@ class MikrotikAPI:
|
|||
}
|
||||
self.lock.acquire()
|
||||
try:
|
||||
_LOGGER.debug("Ping host query: %s", "/ping")
|
||||
# _LOGGER.debug("Ping host query: %s", args["address"])
|
||||
ping = response("/ping", **args)
|
||||
except librouteros.exceptions.ConnectionClosed:
|
||||
self.disconnect()
|
||||
|
@ -485,8 +485,10 @@ class MikrotikAPI:
|
|||
|
||||
for tmp in ping:
|
||||
if "received" in tmp and tmp["received"] > 0:
|
||||
_LOGGER.debug("Ping host success: %s", args["address"])
|
||||
return True
|
||||
|
||||
_LOGGER.debug("Ping host failure: %s", args["address"])
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue