Skip to content

Commit 4eb774d

Browse files
committed
fix ruff issues
1 parent 5f473e0 commit 4eb774d

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

examples/simple.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
"""Simple example of using the Growatt API."""
23

34
import growattServer

examples/sph_mix_write_example.py

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
import growattServer
1313

1414

15-
def main() -> None:
15+
def main() -> None: # noqa: PLR0915
1616
"""Run the main example for SPH/MIX time segment writing."""
1717
# Get the API token from user input or environment variable
1818
api_token = os.environ.get("GROWATT_API_TOKEN") or input(
1919
"Enter your Growatt API token: "
2020
)
2121

2222
# Test token from official API docs (for testing only)
23-
# api_token = "6eb6f069523055a339d71e5b1f6c88cc" # gitleaks:allow
23+
# api_token = "6eb6f069523055a339d71e5b1f6c88cc" # gitleaks:allow # noqa: ERA001
2424

2525
try:
2626
# Initialize the API with token

examples/tlx_example.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
print("Inverter info:", json.dumps(inverter_info, indent=4, sort_keys=True)) # noqa: T201
7070

7171
# PV production data
72-
data = api.tlx_data(inverter_sn, datetime.datetime.now())
72+
data = api.tlx_data(inverter_sn, datetime.datetime.now(tz=datetime.UTC))
7373
print("PV production data:", json.dumps(data, indent=4, sort_keys=True)) # noqa: T201
7474

7575
# System settings
@@ -104,18 +104,18 @@
104104
# Examples of updating settings, uncomment to use
105105

106106
# Set charging power to 95%
107-
# res = api.update_tlx_inverter_setting(inverter_sn, 'charge_power', 95)
108-
# print(res)
107+
# res = api.update_tlx_inverter_setting(inverter_sn, 'charge_power', 95) # noqa: ERA001
108+
# print(res) # noqa: ERA001
109109

110110
# Turn on AC charging
111-
# res = api.update_tlx_inverter_setting(inverter_sn, 'ac_charge', 1)
112-
# print(res)
111+
# res = api.update_tlx_inverter_setting(inverter_sn, 'ac_charge', 1) # noqa: ERA001
112+
# print(res) # noqa: ERA001
113113

114114
# Enable Load First between 00:01 and 11:59 using time segment 1
115115
# res = api.update_tlx_inverter_time_segment(serial_number = inverter_sn,
116-
# segment_id = 1,
117-
# batt_mode = growattServer.BATT_MODE_LOAD_FIRST, # noqa: E501
118-
# start_time = datetime.time(00, 1),
119-
# end_time = datetime.time(11, 59),
116+
# segment_id = 1, # noqa: ERA001
117+
# batt_mode = growattServer.BATT_MODE_LOAD_FIRST, # noqa: E501, ERA001
118+
# start_time = datetime.time(00, 1), # noqa: E501, ERA001
119+
# end_time = datetime.time(11, 59), # noqa: E501, ERA001
120120
# enabled=True)
121-
# print(res)
121+
# print(res) # noqa: ERA001

0 commit comments

Comments
 (0)