@@ -235,14 +235,6 @@ async def _startup(self, auto_form=False):
235
235
c .SYS .SetTxPower .Req (TXPower = dbm ), RspStatus = t .Status .SUCCESS
236
236
)
237
237
238
- if self .znp_config [conf .CONF_LED_MODE ] is not None :
239
- led_mode = self .znp_config [conf .CONF_LED_MODE ]
240
-
241
- await self ._znp .request (
242
- c .Util .LEDControl .Req (LED = 0xFF , Mode = led_mode ),
243
- RspStatus = t .Status .SUCCESS ,
244
- )
245
-
246
238
# Both versions of Z-Stack use this callback
247
239
started_as_coordinator = self ._znp .wait_for_response (
248
240
c .ZDO .StateChangeInd .Callback (State = t .DeviceState .StartedAsCoordinator )
@@ -282,6 +274,16 @@ async def _startup(self, auto_form=False):
282
274
async with async_timeout .timeout (STARTUP_TIMEOUT ):
283
275
await started_as_coordinator
284
276
277
+ # The CC2531 running Z-Stack Home 1.2 overrides the LED setting if it is changed
278
+ # before the coordinator has started.
279
+ if self .znp_config [conf .CONF_LED_MODE ] is not None :
280
+ led_mode = self .znp_config [conf .CONF_LED_MODE ]
281
+
282
+ await self ._znp .request (
283
+ c .Util .LEDControl .Req (LED = 0xFF , Mode = led_mode ),
284
+ RspStatus = t .Status .SUCCESS ,
285
+ )
286
+
285
287
device_info = await self ._znp .request (
286
288
c .Util .GetDeviceInfo .Req (), RspStatus = t .Status .SUCCESS
287
289
)
0 commit comments