Skip to content

Commit 9ff238f

Browse files
committed
get the device.id property for the command handler and use it in the
startup event text (makes debugging easier)
1 parent 71ad454 commit 9ff238f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

IoTSonnenUploader/src/main/java/com/oracle/demo/timg/iot/iotsonnenuploader/mqtt/MqttCommandHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Software and the Larger Work(s), and to sublicense the foregoing rights on
4646
import com.oracle.demo.timg.iot.iotsonnenuploader.devicesettings.DeviceSettings;
4747
import com.oracle.demo.timg.iot.iotsonnenuploader.incommingdata.SonnenConfiguration;
4848

49+
import io.micronaut.context.annotation.Property;
4950
import io.micronaut.context.annotation.Requires;
5051
import io.micronaut.context.event.StartupEvent;
5152
import io.micronaut.mqtt.annotation.MqttSubscriber;
@@ -72,6 +73,9 @@ public class MqttCommandHandler {
7273
@Inject
7374
private ObjectMapper mapper;
7475

76+
@Property(name = DeviceSettings.PREFIX + ".id")
77+
private String deviceId;
78+
7579
@ExecuteOn(TaskExecutors.IO)
7680
@Topic("house/sonnencommand/${" + DeviceSettings.PREFIX + ".id}")
7781
public void receive(CommandReceived command) throws IOException {
@@ -101,6 +105,6 @@ public void receive(CommandReceived command) throws IOException {
101105

102106
@EventListener
103107
public void onStartup(StartupEvent event) {
104-
log.info("Started command handler");
108+
log.info("Started command handler monitoring : house/sonnencommand/" + deviceId);
105109
}
106110
}

0 commit comments

Comments
 (0)