Another fix

This commit is contained in:
Ziver Koc 2021-08-29 22:24:32 +02:00
parent 02f9d4fcb7
commit 08fd1b6edd

View file

@ -200,7 +200,7 @@ public class SmartHomeImpl extends SmartHomeApp implements TokenRegistrationList
DeviceTrait[] traits = DeviceTraitFactory.getTraits(device); DeviceTrait[] traits = DeviceTraitFactory.getTraits(device);
Map<String, Object> deviceState = new HashMap<>(); Map<String, Object> deviceState = new HashMap<>();
if (traits != null) { if (traits.length > 0) {
for (DeviceTrait trait : traits) { for (DeviceTrait trait : traits) {
deviceState.putAll(trait.generateQueryResponse(device.getDeviceData())); deviceState.putAll(trait.generateQueryResponse(device.getDeviceData()));
} }