diff --git a/homeassistant/components/sensor/arest.py b/homeassistant/components/sensor/arest.py index 0af804a4580..3a0ce01719b 100644 --- a/homeassistant/components/sensor/arest.py +++ b/homeassistant/components/sensor/arest.py @@ -132,6 +132,8 @@ class ArestSensor(Entity): value = float(value) * float(self._corr_factor) if self._decimal_places is not None: value = round(value, self._decimal_places) + if self._decimal_places == 0: + value = int(value) return value else: return values.get(self._variable, 'n/a') diff --git a/homeassistant/components/sensor/command_sensor.py b/homeassistant/components/sensor/command_sensor.py index 9dc6ad8c426..e60723f6bfa 100644 --- a/homeassistant/components/sensor/command_sensor.py +++ b/homeassistant/components/sensor/command_sensor.py @@ -79,6 +79,8 @@ class CommandSensor(Entity): value = float(value) * float(self._corr_factor) if self._decimal_places is not None: value = round(value, self._decimal_places) + if self._decimal_places == 0: + value = int(value) self._state = value except ValueError: self._state = value diff --git a/homeassistant/components/sensor/rest.py b/homeassistant/components/sensor/rest.py index abe46d03b95..f50113350da 100644 --- a/homeassistant/components/sensor/rest.py +++ b/homeassistant/components/sensor/rest.py @@ -140,6 +140,8 @@ class RestSensor(Entity): value = float(value) * float(self._corr_factor) if self._decimal_places is not None: value = round(value, self._decimal_places) + if self._decimal_places == 0: + value = int(value) self._state = value except ValueError: self._state = RestSensor.extract_value(value, self._variable)