Skip to content

Commit ef9d95d

Browse files
authored
Correctly handle empty data in async sensor
1 parent 0d60fea commit ef9d95d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/w1thermsensor/async_core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ async def get_raw_sensor_strings(self) -> List[str]: # type: ignore
6262
)
6363

6464
if (
65-
data[0].strip()[-3:] != "YES" or "00 00 00 00 00 00 00 00 00" in data[0]
65+
len(data) < 1
66+
or data[0].strip()[-3:] != "YES"
67+
or "00 00 00 00 00 00 00 00 00" in data[0]
6668
): # pragma: no cover
6769
raise SensorNotReadyError(self)
6870

0 commit comments

Comments
 (0)