Skip to content

Commit

Permalink
fix: services.py - 'response' is not subscriptable
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Aug 13, 2024
1 parent 2fb710c commit af655d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions custom_components/solarman/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ async def read_holding_registers(call: ServiceCall) -> int:

result = {}

for i in range(0, quantity):
result[register + i] = response[i]
if response:
for i in range(0, quantity):
result[register + i] = response[i]

return result

Expand Down Expand Up @@ -114,8 +115,9 @@ async def read_input_registers(call: ServiceCall) -> int:

result = {}

for i in range(0, quantity):
result[register + i] = response[i]
if response:
for i in range(0, quantity):
result[register + i] = response[i]

return result

Expand Down

0 comments on commit af655d3

Please sign in to comment.