code: def connect(self, *, db=None):
          
          if not self.properties.network:
              self.new_state(DeviceFromDB)
          else:
              try:
                  name = self.properties.network.read(
                      "{} device {} objectName".format(
                          self.properties.address, self.properties.device_id
                      )
                  )
  
                  segmentation = self.properties.network.read(
                      "{} device {} segmentationSupported".format(
                          self.properties.address, self.properties.device_id
                      )
                  )
  
                  if not self.segmentation_supported or segmentation not in (
                      "segmentedTransmit",
                      "segmentedBoth",
                  ):
                      segmentation_supported = False
                      self._log.debug("Segmentation not supported")
                  else:
                      segmentation_supported = True
  
                  if name:
                      if segmentation_supported:
                          self.new_state(RPMDeviceConnected)
                      else:
                          self.new_state(RPDeviceConnected)
  
              except SegmentationNotSupported:
                  self.segmentation_supported = False
                  self._log.warning(
                      "Segmentation not supported.... expect slow responses."
                  )
                  self.new_state(RPDeviceConnected)
  
              except (NoResponseFromController, AttributeError) as error:
                  if self.properties.db_name:
                      self.new_state(DeviceFromDB)
                  else:
                      self._log.warning(
                          "Offline: provide database name to load stored data."
                      )
                      self._log.warning("Ex. controller.connect(db = 'backup')")
docs: Attempt to connect to device.  If unable, attempt to connect to a controller database  
          (so the user can use previously saved data).