     }
     
     func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) {
+        reset()
         StoreCenter.store.dispatch(ConnectAction.disconnect)
     }
     
     func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) {
+        reset()
         StoreCenter.store.dispatch(ConnectAction.disconnect)
     }
 }

            self.connectedHub = Duplo.TrainBase()
        }
        
        self.peripheral = peripheral
        centralManager.connect(peripheral, options: nil)
        

            default:
                break
            }
            
            if isInitializingHub {
                isInitializingHub = false
                write(data: HubPropertiesCommand(property: .batteryVoltage, operation: .enableUpdates).data)
            }

        }
    }
}
