[miio] only change the name if it is the default one (#9312)
Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
parent
654db27939
commit
6fe75cb288
|
@ -490,9 +490,12 @@ public abstract class MiIoAbstractHandler extends BaseThingHandler implements Mi
|
||||||
this.pollingJob = null;
|
this.pollingJob = null;
|
||||||
}
|
}
|
||||||
miIoScheduler.schedule(() -> {
|
miIoScheduler.schedule(() -> {
|
||||||
ThingBuilder thingBuilder = editThing();
|
String label = getThing().getLabel();
|
||||||
thingBuilder.withLabel(miDevice.getDescription());
|
if (label == null || label.startsWith("Xiaomi Mi Device")) {
|
||||||
updateThing(thingBuilder.build());
|
ThingBuilder thingBuilder = editThing();
|
||||||
|
thingBuilder.withLabel(miDevice.getDescription());
|
||||||
|
updateThing(thingBuilder.build());
|
||||||
|
}
|
||||||
logger.info("Mi Device model {} identified as: {}. Does not match thingtype {}. Changing thingtype to {}",
|
logger.info("Mi Device model {} identified as: {}. Does not match thingtype {}. Changing thingtype to {}",
|
||||||
modelId, miDevice.toString(), getThing().getThingTypeUID().toString(),
|
modelId, miDevice.toString(), getThing().getThingTypeUID().toString(),
|
||||||
miDevice.getThingType().toString());
|
miDevice.getThingType().toString());
|
||||||
|
|
Loading…
Reference in New Issue