[mqtt.homeassistant] handle null component name (#15427)

* [mqtt.homeassistant] handle null component name

channels from such components will not have a group. this is
now done by zigbee2mqtt for the "default" component of a device,
such as the light. HASS encourages this as of release 2023.8

Signed-off-by: Cody Cutrer <cody@cutrer.us>
This commit is contained in:
Cody Cutrer
2023-11-18 14:46:57 -07:00
committed by GitHub
parent a535caa13c
commit 7fc351c9c2
18 changed files with 111 additions and 70 deletions

View File

@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
@@ -160,7 +161,8 @@ public class HomeAssistantMQTTImplementationTest extends MqttOSGiTest {
ComponentDiscovered cd = (haID, c) -> {
haComponents.put(c.getGroupUID().getId(), c);
c.addChannelTypes(channelTypeProvider);
channelTypeProvider.setChannelGroupType(c.getGroupTypeUID(), c.getType());
channelTypeProvider.setChannelGroupType(Objects.requireNonNull(c.getGroupTypeUID()),
Objects.requireNonNull(c.getType()));
latch.countDown();
};