Skip to content

Commit 50797c4

Browse files
committed
fixes for formatting
1 parent 09cbdc5 commit 50797c4

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

growattServer/open_api_v1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,10 +1126,10 @@ def min_write_parameter(
11261126
parameters[i] = str(value)
11271127
elif isinstance(parameter_values, dict):
11281128
# Dict maps param positions to values
1129-
MAX_PARAMS = 19 # Maximum number of parameters supported
1129+
max_params = 19 # Maximum number of parameters supported
11301130
for pos, value in parameter_values.items():
11311131
param_pos = int(pos) if not isinstance(pos, int) else pos
1132-
if 1 <= param_pos <= MAX_PARAMS: # Validate parameter positions
1132+
if 1 <= param_pos <= max_params: # Validate parameter positions
11331133
parameters[param_pos] = str(value)
11341134

11351135
# IMPORTANT: Create a data dictionary with ALL parameters explicitly included
@@ -1561,7 +1561,7 @@ def min_read_time_segments(
15611561

15621562
return segments
15631563

1564-
def read_time_segments( # noqa: PLR0912
1564+
def read_time_segments( # noqa: PLR0912, PLR0915
15651565
self, device_sn: str, device_type: DeviceType, settings_data: dict | None = None
15661566
) -> list[dict]:
15671567
"""
@@ -1777,7 +1777,7 @@ def read_parameter(
17771777
def common_write_time_segment(
17781778
self,
17791779
command: str,
1780-
params: "TimeSegmentParams | MixAcDischargeTimeParams | MixAcChargeTimeParams",
1780+
params: "OpenApiV1.TimeSegmentParams | OpenApiV1.MixAcDischargeTimeParams | OpenApiV1.MixAcChargeTimeParams",
17811781
) -> dict:
17821782
"""Write a time segment parameter to the device."""
17831783
return self._api.write_time_segment(

setup.py

100755100644
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
"""Setup configuration for growattServer package."""
2+
3+
from pathlib import Path
4+
15
import setuptools
2-
import os
36

4-
with open("README.md", "r") as fh:
5-
long_description = fh.read()
7+
long_description = Path("README.md").read_text(encoding="utf-8")
68

79
setuptools.setup(
810
name="growattServer",

0 commit comments

Comments
 (0)