Skip to content

Commit

Permalink
Run black on project code
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas committed Mar 29, 2023
1 parent 20c6be9 commit d56b470
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions omnikinverter/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,7 @@ def parse_messages(serial_number: int, data: bytes) -> dict[str, Any]:

info = None

for (message_type, reply_serial_number, message) in _unpack_messages(
bytearray(data)
):
for message_type, reply_serial_number, message in _unpack_messages(bytearray(data)):
if reply_serial_number != serial_number: # pragma: no cover
# This is allowed as it does not seem to be required to pass the serial
# number in the request - though empirical testing has to point out whether
Expand Down Expand Up @@ -279,7 +277,7 @@ def temperature_to_float(temp: int) -> Optional[float]:

result: dict[str, Any] = {}

for (name, extractor) in field_extractors.items():
for name, extractor in field_extractors.items():
value = getattr(tcp_data, name)

if name == "ac_output":
Expand Down
1 change: 1 addition & 0 deletions tests/test_omnik.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ async def test_html_no_auth(aresponses: ResponsesMockServer) -> None:
@pytest.mark.asyncio
async def test_timeout(aresponses: ResponsesMockServer) -> None:
"""Test request timeout from Omnik Inverter."""

# Faking a timeout by sleeping
async def response_handler(_: aiohttp.ClientResponse) -> Response:
await asyncio.sleep(0.2)
Expand Down

0 comments on commit d56b470

Please sign in to comment.