[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:
Cody Cutrer 2023-11-18 16:58:25 -07:00 committed by GitHub
parent 8ca03bd5c7
commit c2a6329408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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);