/**
 * Copyright (c) 2014-2015 openHAB UG (haftungsbeschraenkt) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.eclipse.smarthome.io.rest.core.thing;

import org.eclipse.smarthome.core.thing.ThingStatusInfo;
import org.eclipse.smarthome.core.thing.dto.ThingDTO;
import org.eclipse.smarthome.io.rest.core.item.EnrichedGroupItemDTO;

/**
 * This is a data transfer object that is used to serialize things with dynamic data like the status.
 *
 * @author Dennis Nobel - Initial contribution
 *
 */
public class EnrichedThingDTO extends ThingDTO {

    public ThingStatusInfo statusInfo;
    public EnrichedGroupItemDTO item;
    public final String link;

    public EnrichedThingDTO(ThingDTO thingDTO, ThingStatusInfo statusInfo, EnrichedGroupItemDTO item, String link) {
        this.UID = thingDTO.UID;
        this.label = thingDTO.label != null ? thingDTO.label : item.label;
        this.thingTypeUID = thingDTO.thingTypeUID;
        this.bridgeUID = thingDTO.bridgeUID;
        this.channels = thingDTO.channels;
        this.configuration = thingDTO.configuration;
        this.properties = thingDTO.properties;
        this.statusInfo = statusInfo;
        this.item = item;
        this.link = link;
    }

}

@@ -1034,62 +1034,138 @@
     
-this.label = thingDTO.label != null ? thingDTO
+if (thingDTO.label != null) %7B%0A            this.label = thingDTO.label;%0A        %7D else if (item != null) %7B%0A            this
 .label 
-:
+=
  ite
@@ -1165,32 +1165,42 @@
 l = item.label;%0A
+        %7D%0A
         this.thi

Fix exception in EnrichedThingDTO where no label exists