Skip to content

Commit

Permalink
feat: Added SG01HP3
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Jul 4, 2024
1 parent 8ef1544 commit b53e902
Show file tree
Hide file tree
Showing 5 changed files with 1,556 additions and 3 deletions.
4 changes: 2 additions & 2 deletions custom_components/solarman/const.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from datetime import timedelta as td

DOMAIN = 'solarman'
DOMAIN = "solarman"
PLATFORMS: list[str] = ["sensor"]
SENSOR_PREFIX = "Solarman"

DISCOVERY_MESSAGE = "WIFIKIT-214028-READ"
DISCOVERY_PORT = 48899
DISCOVERY_RECV_MESSAGE_SIZE = 1024

DEFINITIONS = 'inverter_definitions'
LOOKUP_DIRECTORY = "inverter_definitions"
LOOKUP_DIRECTORY_PATH = f"custom_components/{DOMAIN}/{LOOKUP_DIRECTORY}/"

Expand Down
2 changes: 1 addition & 1 deletion custom_components/solarman/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def _discover(self, address = "<broadcast>"):

while True:
try:
recv = await loop.sock_recv(sock, 1024)
recv = await loop.sock_recv(sock, DISCOVERY_RECV_MESSAGE_SIZE)
data = recv.decode().split(',')
if len(data) == 3:
self._ip = data[0]
Expand Down
Loading

0 comments on commit b53e902

Please sign in to comment.