diff --git a/modules/hcc-bootstrap/src/main/java/net/sf/dz3r/runtime/config/ConfigurationParser.java b/modules/hcc-bootstrap/src/main/java/net/sf/dz3r/runtime/config/ConfigurationParser.java index f0c41a7f2..05a04d308 100644 --- a/modules/hcc-bootstrap/src/main/java/net/sf/dz3r/runtime/config/ConfigurationParser.java +++ b/modules/hcc-bootstrap/src/main/java/net/sf/dz3r/runtime/config/ConfigurationParser.java @@ -29,6 +29,7 @@ import net.sf.dz3r.runtime.config.mqtt.MqttConfigurationParser; import net.sf.dz3r.runtime.config.onewire.OnewireConfigurationParser; import net.sf.dz3r.runtime.config.schedule.ScheduleConfigurationParser; +import net.sf.dz3r.view.webui.v2.WebUI; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -199,6 +200,7 @@ private EndpointMeta renderMeta(HccRawConfig source, String digest) throws IOExc source.instance(), InstanceIdProvider.getId(), digest, + Optional.ofNullable(source.webUi().duplexPort()).orElse(WebUI.DEFAULT_PORT_DUPLEX), new SimpleClientMeta( zones, devices diff --git a/modules/hcc-data-source-api/src/main/java/com/homeclimatecontrol/hcc/meta/EndpointMeta.java b/modules/hcc-data-source-api/src/main/java/com/homeclimatecontrol/hcc/meta/EndpointMeta.java index 6618063d2..87200fa7f 100644 --- a/modules/hcc-data-source-api/src/main/java/com/homeclimatecontrol/hcc/meta/EndpointMeta.java +++ b/modules/hcc-data-source-api/src/main/java/com/homeclimatecontrol/hcc/meta/EndpointMeta.java @@ -1,16 +1,20 @@ package com.homeclimatecontrol.hcc.meta; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; + /** * The top level metadata the client will see. * - * @param version Version for the clients to determine compatibility. + * @param protocolVersion Version for the clients to determine compatibility. * @param type Endpoint type. Always {@link Type#DIRECT} for the actual HCC instance. * @param instance Instance metadata. * * @author Copyright © Vadim Tkachenko 2001-2023 */ +@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy.class) public record EndpointMeta( - String version, + String protocolVersion, Type type, InstanceMeta instance ) { diff --git a/modules/hcc-data-source-api/src/main/java/com/homeclimatecontrol/hcc/meta/InstanceMeta.java b/modules/hcc-data-source-api/src/main/java/com/homeclimatecontrol/hcc/meta/InstanceMeta.java index c8fb8c4d7..e5fd68a2b 100644 --- a/modules/hcc-data-source-api/src/main/java/com/homeclimatecontrol/hcc/meta/InstanceMeta.java +++ b/modules/hcc-data-source-api/src/main/java/com/homeclimatecontrol/hcc/meta/InstanceMeta.java @@ -14,6 +14,7 @@ * @param name Instance name, taken from {@code HccRawConfig#instance}. * @param id Persistent unique system ID. * @param configDigest Current parsed (not source) configuration message digest. + * @param duplexPort Port to conduct RSocket communications on. * @param simple Simple UI metadata. * @param full Full control metadata. * @@ -24,6 +25,7 @@ public record InstanceMeta( String name, UUID id, String configDigest, + int duplexPort, SimpleClientMeta simple, InstrumentClusterMeta full ) { diff --git a/modules/hcc-webui/src/main/java/net/sf/dz3r/view/webui/v2/WebUI.java b/modules/hcc-webui/src/main/java/net/sf/dz3r/view/webui/v2/WebUI.java index d0fbab3c1..70c597a68 100644 --- a/modules/hcc-webui/src/main/java/net/sf/dz3r/view/webui/v2/WebUI.java +++ b/modules/hcc-webui/src/main/java/net/sf/dz3r/view/webui/v2/WebUI.java @@ -165,7 +165,7 @@ private void advertise() { "path", META_PATH, // http://www.dns-sd.org/txtrecords.html#http "protocol-version", Version.PROTOCOL_VERSION, - "duplex", Integer.toString(config.duplexPort), + "duplex-port", Integer.toString(config.duplexPort), "type",DIRECT.toString().toLowerCase(), "name", config.instance,