@@ -80,8 +80,9 @@ async def _reset_watchdog(self):
8080                await  self ._api .write_parameter (
8181                    NetworkParameter .watchdog_ttl , self ._config [CONF_WATCHDOG_TTL ]
8282                )
83-             except  (asyncio .TimeoutError , zigpy .exceptions .ZigbeeException ):
84-                 LOGGER .warning ("No watchdog response" )
83+             except  Exception  as  e :
84+                 LOGGER .warning ("Failed to reset watchdog" , exc_info = e )
85+ 
8586            await  asyncio .sleep (self ._config [CONF_WATCHDOG_TTL ] *  0.75 )
8687
8788    async  def  connect (self ):
@@ -95,15 +96,7 @@ async def disconnect(self):
9596        if  self ._reset_watchdog_task  is  not None :
9697            self ._reset_watchdog_task .cancel ()
9798
98-         if  self ._api  is  None :
99-             return 
100- 
101-         try :
102-             if  self ._api .protocol_version  >=  PROTO_VER_WATCHDOG :
103-                 await  self ._api .write_parameter (NetworkParameter .watchdog_ttl , 1 )
104-         except  zigpy_deconz .exception .CommandError :
105-             pass 
106-         finally :
99+         if  self ._api  is  not None :
107100            self ._api .close ()
108101
109102    async  def  permit_with_key (self , node : t .EUI64 , code : bytes , time_s = 60 ):
@@ -113,13 +106,10 @@ async def start_network(self):
113106        await  self .register_endpoints ()
114107        await  self .load_network_info (load_devices = False )
115108
116-         device_state , _ , _  =  await  self ._api .device_state ()
117- 
118-         if  device_state .network_state  !=  NetworkState .CONNECTED :
119-             try :
120-                 await  self ._change_network_state (NetworkState .CONNECTED )
121-             except  asyncio .TimeoutError  as  e :
122-                 raise  FormationFailure () from  e 
109+         try :
110+             await  self ._change_network_state (NetworkState .CONNECTED )
111+         except  asyncio .TimeoutError  as  e :
112+             raise  FormationFailure () from  e 
123113
124114        coordinator  =  await  DeconzDevice .new (
125115            self ,
0 commit comments