Skip to content

Commit

Permalink
Correctly handle empty data in async sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
timofurrer authored Aug 31, 2020
1 parent 0d60fea commit ef9d95d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/w1thermsensor/async_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ async def get_raw_sensor_strings(self) -> List[str]: # type: ignore
)

if (
data[0].strip()[-3:] != "YES" or "00 00 00 00 00 00 00 00 00" in data[0]
len(data) < 1
or data[0].strip()[-3:] != "YES"
or "00 00 00 00 00 00 00 00 00" in data[0]
): # pragma: no cover
raise SensorNotReadyError(self)

Expand Down

0 comments on commit ef9d95d

Please sign in to comment.