docs: def new_device(device_json, abode):
      """Create new device object for the given type."""
      type_tag = device_json.get('type_tag')
  
      if not type_tag:
          raise AbodeException((ERROR.UNABLE_TO_MAP_DEVICE))
  
      generic_type = CONST.get_generic_type(type_tag.lower())
      device_json['generic_type'] = generic_type
  
      if generic_type == CONST.TYPE_CONNECTIVITY or \
         generic_type == CONST.TYPE_MOISTURE or \
         generic_type == CONST.TYPE_OPENING:
          return AbodeBinarySensor(device_json, abode)
      elif generic_type == CONST.TYPE_CAMERA:
          return AbodeCamera(device_json, abode)
      elif generic_type == CONST.TYPE_COVER:
          return AbodeCover(device_json, abode)
      elif generic_type == CONST.TYPE_LIGHT:
          return AbodeLight(device_json, abode)
      elif generic_type == CONST.TYPE_LOCK:
          return AbodeLock(device_json, abode)
      elif generic_type == CONST.TYPE_SWITCH:
          return AbodeSwitch(device_json, abode)
      elif generic_type == CONST.TYPE_VALVE:
          return AbodeValve(device_json, abode)
      elif generic_type == CONST.TYPE_UNKNOWN_SENSOR:
          return _new_sensor(device_json, abode)
  
      return None