32
32
_LOGGER = logging .getLogger (__name__ )
33
33
34
34
PLATFORMS : list [Platform ] = [
35
- Platform .SELECT ,
35
+ Platform .LIGHT ,
36
36
Platform .NUMBER ,
37
- Platform .SWITCH ,
37
+ Platform .SELECT ,
38
38
Platform .SENSOR ,
39
- Platform .LIGHT ,
39
+ Platform .SWITCH ,
40
40
]
41
41
42
42
@@ -77,10 +77,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
77
77
uniled = UNILEDBLE (ble_device , service_info .advertisement , model_name )
78
78
79
79
if not uniled .model :
80
- _LOGGER .debug ("*** Resolve Model: %s (%s)" , uniled .name , uniled .model )
80
+ _LOGGER .debug ("*** Resolve BLE Model: %s (%s)" , uniled .name , uniled .model )
81
81
model = await uniled .resolve_model ()
82
82
if model is None :
83
- _LOGGER .error ("%s: Cannot resolve device model" , uniled .name )
84
83
raise ConfigEntryNotReady (
85
84
f"Could not resolve model for BLE device with address { address } "
86
85
)
@@ -106,6 +105,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
106
105
cancel_first_update = uniled .register_callback (lambda * _ : startup_event .set ())
107
106
coordinator = UNILEDUpdateCoordinator (hass , uniled , entry )
108
107
108
+ _LOGGER .debug ("*** Awaiting UniLED Device: %s, response" , uniled .name )
109
+
109
110
try :
110
111
await coordinator .async_config_entry_first_refresh ()
111
112
except ConfigEntryNotReady :
@@ -115,8 +116,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
115
116
bluetooth .async_rediscover_address (hass , address )
116
117
raise
117
118
118
- _LOGGER .debug ("*** Awaiting UniLED Device: %s, response" , uniled .name )
119
-
120
119
try :
121
120
async with async_timeout .timeout (DEVICE_TIMEOUT ):
122
121
await startup_event .wait ()
0 commit comments