Skip to content

Commit 2c7342f

Browse files
committed
fix initial add
1 parent 7203ad9 commit 2c7342f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

custom_components/ac_infinity/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
3838
f"Could not find AC Infinity device with address {address}"
3939
)
4040

41-
controller = ACInfinityController(
42-
ble_device, DeviceInfo(**entry.data[CONF_SERVICE_DATA])
43-
)
41+
device_info: DeviceInfo | dict = entry.data[CONF_SERVICE_DATA]
42+
if type(device_info) is dict:
43+
device_info = DeviceInfo(**entry.data[CONF_SERVICE_DATA])
44+
controller = ACInfinityController(ble_device, device_info)
4445

4546
@callback
4647
def _async_update_ble(

0 commit comments

Comments
 (0)