Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit

Permalink
Fix #40, wrong endpoints data
Browse files Browse the repository at this point in the history
  • Loading branch information
rob42 committed Apr 3, 2017
1 parent c875154 commit 25915ea
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ static Json discovery(String hostname) {

Json version = Json.object();
String ver = Util.getConfigProperty(ConfigConstants.VERSION);
version.set("version", ver.substring(1));
if( ver.startsWith("v")){
ver = ver.substring(1);
}
version.set("version", ver);
version.set(SignalKConstants.websocketUrl, "ws://" + hostname + ":"
+ Util.getConfigPropertyInt(ConfigConstants.WEBSOCKET_PORT)
+ SignalKConstants.SIGNALK_WS);
Expand All @@ -309,7 +312,7 @@ static Json discovery(String hostname) {
version.set(SignalKConstants.mqttPort, "mqtt://" + hostname + ":"
+ Util.getConfigPropertyInt(ConfigConstants.MQTT_PORT));
Json endpoints = Json.object();
endpoints.set(ver.substring(0, 2), version );
endpoints.set("v"+ver.substring(0, ver.indexOf(".")), version );
return Json.object().set("endpoints", endpoints);
}

Expand Down

0 comments on commit 25915ea

Please sign in to comment.