Skip to content

Commit

Permalink
[mqtt.homeassistant] Handle empty device name (openhab#15918)
Browse files Browse the repository at this point in the history
Follow on to openhab#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>
  • Loading branch information
ccutrer authored and andrewfg committed Nov 26, 2023
1 parent 601c06f commit 7e7cb4c
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 7e7cb4c

Please sign in to comment.