Fix Vicare imports (#29071)

* fix import

* Update water_heater.py

* use ValueError

* use ValueError
This commit is contained in:
rappenze 2019-11-26 19:46:53 +01:00 committed by Paulus Schoutsen
parent 2cdd8ad15e
commit 1c73ac5df8
2 changed files with 2 additions and 4 deletions

View file

@ -1,7 +1,6 @@
"""Viessmann ViCare climate device.""" """Viessmann ViCare climate device."""
import logging import logging
import requests import requests
import simplejson
from homeassistant.components.climate import ClimateDevice from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import ( from homeassistant.components.climate.const import (
@ -169,7 +168,7 @@ class ViCareClimate(ClimateDevice):
] = self._api.getReturnTemperature() ] = self._api.getReturnTemperature()
except requests.exceptions.ConnectionError: except requests.exceptions.ConnectionError:
_LOGGER.error("Unable to retrieve data from ViCare server") _LOGGER.error("Unable to retrieve data from ViCare server")
except simplejson.errors.JSONDecodeError: except ValueError:
_LOGGER.error("Unable to decode data from ViCare server") _LOGGER.error("Unable to decode data from ViCare server")
@property @property

View file

@ -1,7 +1,6 @@
"""Viessmann ViCare water_heater device.""" """Viessmann ViCare water_heater device."""
import logging import logging
import requests import requests
import simplejson
from homeassistant.components.water_heater import ( from homeassistant.components.water_heater import (
SUPPORT_TARGET_TEMPERATURE, SUPPORT_TARGET_TEMPERATURE,
@ -93,7 +92,7 @@ class ViCareWater(WaterHeaterDevice):
self._current_mode = self._api.getActiveMode() self._current_mode = self._api.getActiveMode()
except requests.exceptions.ConnectionError: except requests.exceptions.ConnectionError:
_LOGGER.error("Unable to retrieve data from ViCare server") _LOGGER.error("Unable to retrieve data from ViCare server")
except simplejson.errors.JSONDecodeError: except ValueError:
_LOGGER.error("Unable to decode data from ViCare server") _LOGGER.error("Unable to decode data from ViCare server")
@property @property