[mqtt.homeassistant] Handle empty device name (#15918)
Follow on to #15427 ring-mqtt sends `"name": ""`, not `"name": null` or simply omitting it, so be sure to handle that way as well Signed-off-by: Cody Cutrer <cody@cutrer.us>
This commit is contained in:
parent
8ca03bd5c7
commit
c2a6329408
|
@ -86,7 +86,8 @@ public abstract class AbstractComponent<C extends AbstractChannelConfiguration>
|
|||
|
||||
this.haID = componentConfiguration.getHaID();
|
||||
|
||||
if (channelConfiguration.getName() != null) {
|
||||
String name = channelConfiguration.getName();
|
||||
if (name != null && !name.isEmpty()) {
|
||||
String groupId = this.haID.getGroupId(channelConfiguration.getUniqueId());
|
||||
|
||||
this.channelGroupTypeUID = new ChannelGroupTypeUID(MqttBindingConstants.BINDING_ID, groupId);
|
||||
|
|
Loading…
Reference in New Issue