Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gijzelaerr committed Nov 2, 2024
1 parent a8fd508 commit 7068b58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snap7/util/getters.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def get_lreal(bytearray_: bytearray, byte_index: int) -> float:
>>> from snap7 import Client
>>> data = Client().db_read(db_number=1, start=10, size=8)
>>> get_lreal(data, 0)
12345.12345
12345.12345
"""
return float(struct.unpack_from(">d", bytearray_, offset=byte_index)[0])

Expand Down Expand Up @@ -636,7 +636,7 @@ def get_char(bytearray_: bytearray, byte_index: int) -> str:
>>> from snap7 import Client
>>> data = Client().db_read(db_number=1, start=10, size=1)
>>> get_char(data, 0)
'C'
'C'
"""
char = chr(bytearray_[byte_index])
return char
Expand All @@ -659,7 +659,7 @@ def get_wchar(bytearray_: bytearray, byte_index: int) -> str:
>>> from snap7 import Client
>>> data = Client().db_read(db_number=1, start=10, size=2)
>>> get_wchar(data, 0)
'C'
'C'
"""
if bytearray_[byte_index] == 0:
return chr(bytearray_[1])
Expand Down

0 comments on commit 7068b58

Please sign in to comment.