[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;
|
||||
}
|
||||
miIoScheduler.schedule(() -> {
|
||||
ThingBuilder thingBuilder = editThing();
|
||||
thingBuilder.withLabel(miDevice.getDescription());
|
||||
updateThing(thingBuilder.build());
|
||||
String label = getThing().getLabel();
|
||||
if (label == null || label.startsWith("Xiaomi Mi Device")) {
|
||||
ThingBuilder thingBuilder = editThing();
|
||||
thingBuilder.withLabel(miDevice.getDescription());
|
||||
updateThing(thingBuilder.build());
|
||||
}
|
||||
logger.info("Mi Device model {} identified as: {}. Does not match thingtype {}. Changing thingtype to {}",
|
||||
modelId, miDevice.toString(), getThing().getThingTypeUID().toString(),
|
||||
miDevice.getThingType().toString());
|
||||
|
|
Loading…
Reference in New Issue