From 8ef2abfca7294d34a07ad69a6534c000cc5499ce Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Fri, 20 Apr 2018 08:45:28 +0200 Subject: [PATCH] Log an error instead of raising an exception (#14006) --- homeassistant/components/sensor/sht31.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/sensor/sht31.py b/homeassistant/components/sensor/sht31.py index 1ba6c8f90eb..e1a7f3c9e5f 100644 --- a/homeassistant/components/sensor/sht31.py +++ b/homeassistant/components/sensor/sht31.py @@ -14,7 +14,6 @@ import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( TEMP_CELSIUS, CONF_NAME, CONF_MONITORED_CONDITIONS) -from homeassistant.exceptions import HomeAssistantError import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.temperature import display_temp @@ -58,8 +57,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None): if sensor.read_status() is None: raise ValueError("CRC error while reading SHT31 status") except (OSError, ValueError): - raise HomeAssistantError("SHT31 sensor not detected at address %s " % - hex(i2c_address)) + _LOGGER.error( + "SHT31 sensor not detected at address %s", hex(i2c_address)) + return sensor_client = SHTClient(sensor) sensor_classes = {