Skip to content

Commit

Permalink
fixed wrong devicemodel key and cleaned-up code based on review findings
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Zanker <gerd.zanker@web.de>
  • Loading branch information
GerdZanker committed Feb 19, 2023
1 parent 830fb1a commit 4cca586
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class ThingDiscoveryService extends AbstractDiscoveryService implements T
new AbstractMap.SimpleEntry<>("TWINGUARD", BoschSHCBindingConstants.THING_TYPE_TWINGUARD),
new AbstractMap.SimpleEntry<>("PSM", BoschSHCBindingConstants.THING_TYPE_INWALL_SWITCH), // Steckdosen Zwischenstecker
new AbstractMap.SimpleEntry<>("PLUG_COMPACT", BoschSHCBindingConstants.THING_TYPE_SMART_PLUG_COMPACT),
new AbstractMap.SimpleEntry<>("CAMERA_350", BoschSHCBindingConstants.THING_TYPE_CAMERA_360),
new AbstractMap.SimpleEntry<>("CAMERA_360", BoschSHCBindingConstants.THING_TYPE_CAMERA_360),
new AbstractMap.SimpleEntry<>("CAMERA_EYES", BoschSHCBindingConstants.THING_TYPE_CAMERA_EYES),
new AbstractMap.SimpleEntry<>("BWTH", BoschSHCBindingConstants.THING_TYPE_THERMOSTAT), // wall thermostat
new AbstractMap.SimpleEntry<>("THB", BoschSHCBindingConstants.THING_TYPE_WALL_THERMOSTAT), // wall thermostat with batteries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ public void testAddDevice() {
verify(discoveryListener).thingDiscovered(discoveryServiceCaptor.capture(), discoveryResultCaptor.capture());

assertThat(discoveryServiceCaptor.getValue().getClass(), is(ThingDiscoveryService.class));
assertThat(discoveryResultCaptor.getValue().getBindingId(), is(BoschSHCBindingConstants.BINDING_ID));
assertThat(discoveryResultCaptor.getValue().getThingTypeUID(),
is(BoschSHCBindingConstants.THING_TYPE_TWINGUARD));
assertThat(discoveryResultCaptor.getValue().getThingUID().getId(), is("testDevice_ID"));
assertThat(discoveryResultCaptor.getValue().getBridgeUID().getId(), is("testSHC"));
assertThat(discoveryResultCaptor.getValue().getLabel(), is("Test Name"));
assertThat(discoveryResultCaptor.getValue().getProperties().get("Location").toString(), is("TestRoom"));
DiscoveryResult result = discoveryResultCaptor.getValue();
assertThat(result.getBindingId(), is(BoschSHCBindingConstants.BINDING_ID));
assertThat(result.getThingTypeUID(), is(BoschSHCBindingConstants.THING_TYPE_TWINGUARD));
assertThat(result.getThingUID().getId(), is("testDevice_ID"));
assertThat(result.getBridgeUID().getId(), is("testSHC"));
assertThat(result.getLabel(), is("Test Name"));
assertThat(result.getProperties().get("Location").toString(), is("TestRoom"));
}

@Test
Expand Down

0 comments on commit 4cca586

Please sign in to comment.