Skip to content

Commit

Permalink
Fix track_change error in utility_meter (#21134)
Browse files Browse the repository at this point in the history
* split validation

* remove any()
  • Loading branch information
dgomes authored and balloob committed Feb 18, 2019
1 parent d556937 commit c544845
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions homeassistant/components/utility_meter/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ def __init__(self, source_entity, name, meter_type, meter_offset=0,
@callback
def async_reading(self, entity, old_state, new_state):
"""Handle the sensor state changes."""
if any([old_state is None,
old_state.state in [STATE_UNKNOWN, STATE_UNAVAILABLE],
new_state.state in [STATE_UNKNOWN, STATE_UNAVAILABLE]]):
if old_state is None or new_state is None or\
old_state.state in [STATE_UNKNOWN, STATE_UNAVAILABLE] or\
new_state.state in [STATE_UNKNOWN, STATE_UNAVAILABLE]:
return

if self._unit_of_measurement is None and\
Expand Down

0 comments on commit c544845

Please sign in to comment.