Skip to content

Commit 2f43914

Browse files
committed
fix: Device info build w/o entry_id
1 parent d5ef5ee commit 2f43914

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

custom_components/solarman/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def build_device_info(entry_id, serial, mac, host, info, name):
103103
manufacturer = dev_man[0].capitalize()
104104
model = dev_man[1].upper()
105105

106-
device_info["identifiers"] = ({(DOMAIN, entry_id)} if entry_id else {}) | ({(DOMAIN, serial)} if serial else {})
107-
device_info["connections"] = {(CONNECTION_NETWORK_MAC, format_mac(mac))} if mac else {}
106+
device_info["identifiers"] = ({(DOMAIN, entry_id)} if entry_id else set()) | ({(DOMAIN, serial)} if serial else set())
107+
device_info["connections"] = {(CONNECTION_NETWORK_MAC, format_mac(mac))} if mac else set()
108108
device_info["configuration_url"] = f"http://{host}/config_hide.html" if host else None
109109
device_info["serial_number"] = serial if serial else None
110110
device_info["manufacturer"] = manufacturer

0 commit comments

Comments
 (0)