From f3d50e2104d14dec45d7ad5ac1ffdf1c146e6763 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 13 Sep 2020 09:44:37 -0500 Subject: [PATCH] Do not log an error when a host is unreachable while pinging (#40024) --- homeassistant/components/ping/binary_sensor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/ping/binary_sensor.py b/homeassistant/components/ping/binary_sensor.py index df93aaaf5f1..afbfe80b43f 100644 --- a/homeassistant/components/ping/binary_sensor.py +++ b/homeassistant/components/ping/binary_sensor.py @@ -213,7 +213,8 @@ class PingDataSubProcess(PingData): out_error, ) - if pinger.returncode != 0: + if pinger.returncode > 1: + # returncode of 1 means the host is unreachable _LOGGER.exception( "Error running command: `%s`, return code: %s", " ".join(self._ping_cmd),