@@ -108,12 +108,13 @@ public void correctSupportedTypes() {
108108 }
109109
110110 @ Test
111- public void validDiscoveryResultWhiteLightW () {
111+ public void validDiscoveryResultWhiteLightW () throws InterruptedException {
112112 String json = "{\" 9001\" :\" TRADFRI bulb E27 W opal 1000lm\" ,\" 9002\" :1492856270,\" 9020\" :1507194357,\" 9003\" :65537,\" 3311\" :[{\" 5850\" :1,\" 5851\" :254,\" 9003\" :0}],\" 9054\" :0,\" 5750\" :2,\" 9019\" :1,\" 3\" :{\" 0\" :\" IKEA of Sweden\" ,\" 1\" :\" TRADFRI bulb E27 W opal 1000lm\" ,\" 2\" :\" \" ,\" 3\" :\" 1.2.214\" ,\" 6\" :1}}" ;
113113 JsonObject data = JsonParser .parseString (json ).getAsJsonObject ();
114114
115115 discovery .onUpdate ("65537" , data );
116116
117+ Thread .sleep (500L );
117118 assertNotNull (discoveryResult );
118119 assertThat (discoveryResult .getFlag (), is (DiscoveryResultFlag .NEW ));
119120 assertThat (discoveryResult .getThingUID (), is (new ThingUID ("tradfri:0100:1:65537" )));
@@ -124,12 +125,13 @@ public void validDiscoveryResultWhiteLightW() {
124125 }
125126
126127 @ Test
127- public void validDiscoveryResultWhiteLightWS () {
128+ public void validDiscoveryResultWhiteLightWS () throws InterruptedException {
128129 String json = "{\" 9001\" :\" TRADFRI bulb E27 WS opal 980lm\" ,\" 9002\" :1492955148,\" 9020\" :1507200447,\" 9003\" :65537,\" 3311\" :[{\" 5710\" :26909,\" 5850\" :1,\" 5851\" :203,\" 5707\" :0,\" 5708\" :0,\" 5709\" :30140,\" 5711\" :370,\" 5706\" :\" f1e0b5\" ,\" 9003\" :0}],\" 9054\" :0,\" 5750\" :2,\" 9019\" :1,\" 3\" :{\" 0\" :\" IKEA of Sweden\" ,\" 1\" :\" TRADFRI bulb E27 WS opal 980lm\" ,\" 2\" :\" \" ,\" 3\" :\" 1.2.217\" ,\" 6\" :1}}" ;
129130 JsonObject data = JsonParser .parseString (json ).getAsJsonObject ();
130131
131132 discovery .onUpdate ("65537" , data );
132133
134+ Thread .sleep (500L );
133135 assertNotNull (discoveryResult );
134136 assertThat (discoveryResult .getFlag (), is (DiscoveryResultFlag .NEW ));
135137 assertThat (discoveryResult .getThingUID (), is (new ThingUID ("tradfri:0220:1:65537" )));
@@ -140,14 +142,15 @@ public void validDiscoveryResultWhiteLightWS() {
140142 }
141143
142144 @ Test
143- public void validDiscoveryResultWhiteLightWSWithIncompleteJson () {
145+ public void validDiscoveryResultWhiteLightWSWithIncompleteJson () throws InterruptedException {
144146 // We do not always receive a COLOR = "5706" attribute, even the light supports it - but the gateway does not
145147 // seem to have this information, if the bulb is unreachable.
146148 String json = "{\" 9001\" :\" TRADFRI bulb E27 WS opal 980lm\" ,\" 9002\" :1492955148,\" 9020\" :1506968670,\" 9003\" :65537,\" 3311\" :[{\" 9003\" :0}],\" 9054\" :0,\" 5750\" :2,\" 9019\" :0,\" 3\" :{\" 0\" :\" IKEA of Sweden\" ,\" 1\" :\" TRADFRI bulb E27 WS opal 980lm\" ,\" 2\" :\" \" ,\" 3\" :\" 1.2.217\" ,\" 6\" :1}}" ;
147149 JsonObject data = JsonParser .parseString (json ).getAsJsonObject ();
148150
149151 discovery .onUpdate ("65537" , data );
150152
153+ Thread .sleep (500L );
151154 assertNotNull (discoveryResult );
152155 assertThat (discoveryResult .getFlag (), is (DiscoveryResultFlag .NEW ));
153156 assertThat (discoveryResult .getThingUID (), is (new ThingUID ("tradfri:0220:1:65537" )));
@@ -158,12 +161,13 @@ public void validDiscoveryResultWhiteLightWSWithIncompleteJson() {
158161 }
159162
160163 @ Test
161- public void validDiscoveryResultColorLightCWS () {
164+ public void validDiscoveryResultColorLightCWS () throws InterruptedException {
162165 String json = "{\" 9001\" :\" TRADFRI bulb E27 CWS opal 600lm\" ,\" 9002\" :1505151864,\" 9020\" :1505433527,\" 9003\" :65550,\" 9019\" :1,\" 9054\" :0,\" 5750\" :2,\" 3\" :{\" 0\" :\" IKEA of Sweden\" ,\" 1\" :\" TRADFRI bulb E27 CWS opal 600lm\" ,\" 2\" :\" \" ,\" 3\" :\" 1.3.002\" ,\" 6\" :1},\" 3311\" :[{\" 5850\" :1,\" 5708\" :0,\" 5851\" :254,\" 5707\" :0,\" 5709\" :33137,\" 5710\" :27211,\" 5711\" :0,\" 5706\" :\" efd275\" ,\" 9003\" :0}]}" ;
163166 JsonObject data = JsonParser .parseString (json ).getAsJsonObject ();
164167
165168 discovery .onUpdate ("65550" , data );
166169
170+ Thread .sleep (500L );
167171 assertNotNull (discoveryResult );
168172 assertThat (discoveryResult .getFlag (), is (DiscoveryResultFlag .NEW ));
169173 assertThat (discoveryResult .getThingUID (), is (new ThingUID ("tradfri:0210:1:65550" )));
@@ -174,12 +178,13 @@ public void validDiscoveryResultColorLightCWS() {
174178 }
175179
176180 @ Test
177- public void validDiscoveryResultAlternativeColorLightCWS () {
181+ public void validDiscoveryResultAlternativeColorLightCWS () throws InterruptedException {
178182 String json = "{\" 3311\" :[{\" 5850\" :1,\" 5709\" :32886,\" 5851\" :216,\" 5707\" :5309,\" 5708\" :52400,\" 5710\" :27217,\" 5706\" :\" efd275\" ,\" 9003\" :0}],\" 9001\" :\" Mushroom lamp\" ,\" 9002\" :1571036916,\" 9020\" :1571588312,\" 9003\" :65539,\" 9054\" :0,\" 9019\" :1,\" 3\" :{\" 0\" :\" IKEA of Sweden\" ,\" 1\" :\" TRADFRI bulb E27 C\\ /WS opal 600\" ,\" 2\" :\" \" ,\" 3\" :\" 1.3.009\" ,\" 6\" :1},\" 5750\" :2}" ;
179183 JsonObject data = JsonParser .parseString (json ).getAsJsonObject ();
180184
181185 discovery .onUpdate ("65539" , data );
182186
187+ Thread .sleep (500L );
183188 assertNotNull (discoveryResult );
184189 assertThat (discoveryResult .getFlag (), is (DiscoveryResultFlag .NEW ));
185190 assertThat (discoveryResult .getThingUID (), is (new ThingUID ("tradfri:0210:1:65539" )));
@@ -190,12 +195,13 @@ public void validDiscoveryResultAlternativeColorLightCWS() {
190195 }
191196
192197 @ Test
193- public void validDiscoveryResultRemoteControl () {
198+ public void validDiscoveryResultRemoteControl () throws InterruptedException {
194199 String json = "{\" 9001\" :\" TRADFRI remote control\" ,\" 9002\" :1492843083,\" 9020\" :1506977986,\" 9003\" :65536,\" 9054\" :0,\" 5750\" :0,\" 9019\" :1,\" 3\" :{\" 0\" :\" IKEA of Sweden\" ,\" 1\" :\" TRADFRI remote control\" ,\" 2\" :\" \" ,\" 3\" :\" 1.2.214\" ,\" 6\" :3,\" 9\" :47},\" 15009\" :[{\" 9003\" :0}]}" ;
195200 JsonObject data = JsonParser .parseString (json ).getAsJsonObject ();
196201
197202 discovery .onUpdate ("65536" , data );
198203
204+ Thread .sleep (500L );
199205 assertNotNull (discoveryResult );
200206 assertThat (discoveryResult .getFlag (), is (DiscoveryResultFlag .NEW ));
201207 assertThat (discoveryResult .getThingUID (), is (new ThingUID ("tradfri:0830:1:65536" )));
@@ -206,12 +212,13 @@ public void validDiscoveryResultRemoteControl() {
206212 }
207213
208214 @ Test
209- public void validDiscoveryResultWirelessDimmer () {
215+ public void validDiscoveryResultWirelessDimmer () throws InterruptedException {
210216 String json = "{\" 9001\" :\" TRADFRI wireless dimmer\" ,\" 9002\" :1492843083,\" 9020\" :1506977986,\" 9003\" :65536,\" 9054\" :0,\" 5750\" :0,\" 9019\" :1,\" 3\" :{\" 0\" :\" IKEA of Sweden\" ,\" 1\" :\" TRADFRI wireless dimmer\" ,\" 2\" :\" \" ,\" 3\" :\" 1.2.214\" ,\" 6\" :3,\" 9\" :47},\" 15009\" :[{\" 9003\" :0}]}" ;
211217 JsonObject data = JsonParser .parseString (json ).getAsJsonObject ();
212218
213219 discovery .onUpdate ("65536" , data );
214220
221+ Thread .sleep (500L );
215222 assertNotNull (discoveryResult );
216223 assertThat (discoveryResult .getFlag (), is (DiscoveryResultFlag .NEW ));
217224 assertThat (discoveryResult .getThingUID (), is (new ThingUID ("tradfri:0820:1:65536" )));
@@ -222,12 +229,13 @@ public void validDiscoveryResultWirelessDimmer() {
222229 }
223230
224231 @ Test
225- public void validDiscoveryResultMotionSensor () {
232+ public void validDiscoveryResultMotionSensor () throws InterruptedException {
226233 String json = "{\" 9001\" :\" TRADFRI motion sensor\" ,\" 9002\" :1492955083,\" 9020\" :1507120083,\" 9003\" :65538,\" 9054\" :0,\" 5750\" :4,\" 9019\" :1,\" 3\" :{\" 0\" :\" IKEA of Sweden\" ,\" 1\" :\" TRADFRI motion sensor\" ,\" 2\" :\" \" ,\" 3\" :\" 1.2.214\" ,\" 6\" :3,\" 9\" :60},\" 3300\" :[{\" 9003\" :0}]}" ;
227234 JsonObject data = JsonParser .parseString (json ).getAsJsonObject ();
228235
229236 discovery .onUpdate ("65538" , data );
230237
238+ Thread .sleep (500L );
231239 assertNotNull (discoveryResult );
232240 assertThat (discoveryResult .getFlag (), is (DiscoveryResultFlag .NEW ));
233241 assertThat (discoveryResult .getThingUID (), is (new ThingUID ("tradfri:0107:1:65538" )));
@@ -238,12 +246,13 @@ public void validDiscoveryResultMotionSensor() {
238246 }
239247
240248 @ Test
241- public void validDiscoveryResultAirPurifier () {
249+ public void validDiscoveryResultAirPurifier () throws InterruptedException {
242250 String json = "{\" 3\" :{\" 0\" :\" IKEAofSweden\" ,\" 1\" :\" STARKVINDAirpurifier\" ,\" 2\" :\" \" ,\" 3\" :\" 1.0.033\" ,\" 6\" :1,\" 7\" :4364},\" 5750\" :10,\" 9001\" :\" Luftreiniger\" ,\" 9002\" :1633096623,\" 9003\" :65548,\" 9019\" :1,\" 9020\" :1633096633,\" 9054\" :0,\" 15025\" :[{\" 5900\" :1,\" 5902\" :2,\" 5903\" :0,\" 5904\" :259200,\" 5905\" :0,\" 5906\" :0,\" 5907\" :5,\" 5908\" :10,\" 5909\" :2,\" 5910\" :259198,\" 9003\" :0}]}" ;
243251 JsonObject data = JsonParser .parseString (json ).getAsJsonObject ();
244252
245253 discovery .onUpdate ("65548" , data );
246254
255+ Thread .sleep (500L );
247256 assertNotNull (discoveryResult );
248257 assertThat (discoveryResult .getFlag (), is (DiscoveryResultFlag .NEW ));
249258 assertThat (discoveryResult .getThingUID (), is (new ThingUID ("tradfri:0007:1:65548" )));
0 commit comments