Skip to content

Commit 40b6547

Browse files
authored
GoodWe second battery - fix index detection (#2546)
* add second battery and update config * fix no attribute error * fix register adresses * detect battery index
1 parent 92a8531 commit 40b6547

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/modules/devices/good_we/good_we/bat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515

1616
class KwargsDict(TypedDict):
17+
device_id: int
1718
modbus_id: int
1819
version: GoodWeVersion
1920
firmware: int

packages/modules/devices/good_we/good_we/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def __init__(self,
3232

3333

3434
class GoodWeBatConfiguration:
35-
def __init__(self):
36-
pass
35+
def __init__(self, battery_index: int = 1):
36+
self.battery_index = battery_index
3737

3838

3939
class GoodWeBatSetup(ComponentSetup[GoodWeBatConfiguration]):

0 commit comments

Comments
 (0)