class DeviceLogic {

	public DeviceEntity setNewDeviceName(String deviceUri, String newName) {
		DeviceEntity deviceToChange = this.deviceRegistry.findDeviceWithUri(deviceUri);
		if (deviceToChange != null) {
			deviceToChange.setName(newName);
			this.deviceRegistry.save(deviceToChange);
			return deviceToChange;
		}
		return null;
	}

}