Skip to content

Commit

Permalink
[mqtt.homeassistant] Handle empty device name (#15918)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ccutrer authored Nov 18, 2023
1 parent 8ca03bd commit c2a6329
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public AbstractComponent(ComponentFactory.ComponentConfiguration componentConfig

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);
Expand Down

0 comments on commit c2a6329

Please sign in to comment.