Fix #22648 - Utility_meter would try to cancel a non existing task (#22669)

* don't cancel tariff that are paused

* test tariffs
This commit is contained in:
Diogo Gomes authored and Pascal Vizeli committed 2019-04-03 08:49:53 +02:00
1 parent a7d49e40c0
commit 7c5846aed2
2 files changed
+40 -6

No files matched your search

@@ -118,7 +118,8 @@ class UtilityMeterSensor(RestoreEntity):
self._collecting = async_track_state_change(
self.hass, self._sensor_source_id, self.async_reading)
else:
self._collecting()
if self._collecting:
self._collecting()
self._collecting = None
_LOGGER.debug("%s - %s - source <%s>", self._name,