Skip to content

Commit

Permalink
Upstream Updates (#17)
Browse files Browse the repository at this point in the history
* UI: fix & update translations (OpenEMS#2595)

* Fix Emergency-Slider Translation
* Fix EMERGENCY_RESERVE Case Match

* Gitpod: add names+descriptions to ports (OpenEMS#2600)

* UI: add eslint:recommended and plugin:@typescript-eslint/recommended (OpenEMS#2577)

* add "eslint:recommended", "plugin:@typescript-eslint/recommended" to eslintrc
* `eslint --fix src/`

* Push version to 2024.4.0

* Start development of version 2024.5.0-SNAPSHOT

* MQTT API Controller: add optional config parameter to specify a topic prefix (OpenEMS#2553)

Co-authored-by: Stefan Feilmeier <stefan.feilmeier@fenecon.de>

* Bump com.squareup.retrofit2:retrofit from 2.10.0 to 2.11.0 in /cnf (OpenEMS#2606)

* Bump com.squareup.retrofit2:converter-gson from 2.10.0 to 2.11.0 in /cnf

Bumps [com.squareup.retrofit2:converter-gson](https://github.com/square/retrofit) from 2.10.0 to 2.11.0.
- [Release notes](https://github.com/square/retrofit/releases)
- [Changelog](https://github.com/square/retrofit/blob/trunk/CHANGELOG.md)
- [Commits](square/retrofit@2.10.0...2.11.0)

---
updated-dependencies:
- dependency-name: com.squareup.retrofit2:converter-gson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump com.squareup.retrofit2:adapter-rxjava3 in /cnf

Bumps [com.squareup.retrofit2:adapter-rxjava3](https://github.com/square/retrofit) from 2.10.0 to 2.11.0.
- [Release notes](https://github.com/square/retrofit/releases)
- [Changelog](https://github.com/square/retrofit/blob/trunk/CHANGELOG.md)
- [Commits](square/retrofit@2.10.0...2.11.0)

---
updated-dependencies:
- dependency-name: com.squareup.retrofit2:adapter-rxjava3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump com.squareup.retrofit2:converter-scalars in /cnf

Bumps [com.squareup.retrofit2:converter-scalars](https://github.com/square/retrofit) from 2.10.0 to 2.11.0.
- [Release notes](https://github.com/square/retrofit/releases)
- [Changelog](https://github.com/square/retrofit/blob/trunk/CHANGELOG.md)
- [Commits](square/retrofit@2.10.0...2.11.0)

---
updated-dependencies:
- dependency-name: com.squareup.retrofit2:converter-scalars
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump com.squareup.retrofit2:retrofit from 2.10.0 to 2.11.0 in /cnf

Bumps [com.squareup.retrofit2:retrofit](https://github.com/square/retrofit) from 2.10.0 to 2.11.0.
- [Release notes](https://github.com/square/retrofit/releases)
- [Changelog](https://github.com/square/retrofit/blob/trunk/CHANGELOG.md)
- [Commits](square/retrofit@2.10.0...2.11.0)

---
updated-dependencies:
- dependency-name: com.squareup.retrofit2:retrofit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update bnd

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stefan Feilmeier <stefan.feilmeier@fenecon.de>

* UI: Fix CSS in footer (OpenEMS#2594)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Stefan Feilmeier <stefan.feilmeier@fenecon.de>
Co-authored-by: Hiromasa Ihara <iharahiromasa@gmail.com>
Co-authored-by: samuelBloch <125453026+samuelBloch@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Apr 8, 2024
1 parent 42d553f commit 5ac117c
Show file tree
Hide file tree
Showing 199 changed files with 1,391 additions and 1,659 deletions.
51 changes: 34 additions & 17 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,46 @@ tasks:
command: odoo -d prod --addons-path=/workspace/odoo/addons-enabled -i base,partner_firstname,web_m2x_options,stock,openems
ports:
# Backend
- port: 8075 # Backend-to-Backend JSON/REST Api
- name: OpenEMS UI
description: OpenEMS User-Interface. Login admin:admin
port: 4200
onOpen: open-browser
- name: OpenEMS Backend - Odoo. Login admin:admin
description: Odoo - Open Source ERP und CRM
port: 8069
onOpen: open-browser
- name: OpenEMS Backend - Apache Felix Web Console
description: Configure Backend OSGi components via `/system/console/configMgr`
port: 8079
onOpen: ignore
- port: 8076 # Backend-to-Backend JSON/Websocket Api
- name: OpenEMS Edge - Apache Felix Web Console
description: Configure Edge OSGi components via `/system/console/configMgr`
port: 8080
onOpen: ignore
- port: 8079 # Apache Felix Web Console
- name: OpenEMS Backend - Backend-to-Backend JSON/REST Api
description: Cloud-side JSON/REST Api
port: 8075
onOpen: ignore
- port: 8081 # Edge-Websocket
- name: OpenEMS Backend - Backend-to-Backend JSON/Websocket Api
description: Cloud-side JSON/Websocket Api
port: 8076
onOpen: ignore
- port: 8082 # UI-Websocket
- name: OpenEMS Backend - Odoo XML-RPC Api
port: 5432
onOpen: ignore
# Edge
- port: 8080 # Apache Felix Web Console
- name: OpenEMS Backend - Edge-Websocket
description: OpenEMS Edges connect here
port: 8081
onOpen: ignore
- port: 8084 # JSON/REST Api
- name: OpenEMS Backend - UI-Websocket
description: OpenEMS UIs connect here
port: 8082
onOpen: ignore
- port: 8085 # JSON/Websocket Api
- name: OpenEMS Edge - JSON/REST Api
description: Local JSON/REST Api
port: 8084
onOpen: ignore
# UI
- port: 4200
onOpen: open-browser
# Odoo
- port: 8069
onOpen: open-browser
- port: 5432
- name: OpenEMS Edge - JSON/Websocket Api
description: Local JSON/Websocket Api
port: 8085
onOpen: ignore
8 changes: 4 additions & 4 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,25 @@
<!-- Used by com.influxdb: influxdb-client -->
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
</dependency>
<dependency>
<!-- Used by com.influxdb: influxdb-client -->
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
</dependency>
<dependency>
<!-- Used by com.influxdb: influxdb-client -->
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-scalars</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
</dependency>
<dependency>
<!-- Used by com.influxdb: influxdb -->
<groupId>com.squareup.retrofit2</groupId>
<artifactId>adapter-rxjava3</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
</dependency>
<dependency>
<!-- JavaBeans Activation Framework -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class OpenemsConstants {
* <p>
* This is the month of the release.
*/
public static final short VERSION_MINOR = 4;
public static final short VERSION_MINOR = 5;

/**
* The patch version of OpenEMS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
@AttributeDefinition(name = "Edge-ID", description = "Client-ID for authentication at MQTT broker")
String clientId() default "edge0";

@AttributeDefinition(name = "Topic prefix", description = "Optional topic prefix (<topic_prefix>/edge/<edge_id>/...)")
String topicPrefix() default "";

@AttributeDefinition(name = "Username", description = "Username for authentication at MQTT broker")
String username();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

public interface ControllerApiMqtt extends Controller, OpenemsComponent, EventHandler {

public static final String TOPIC_PREFIX = "edge/%s/";
public static final String TOPIC_CHANNEL_PREFIX = "channel/";
public static final String TOPIC_CHANNEL_LAST_UPDATE = "lastUpdate";
public static final String TOPIC_EDGE_CONFIG = "edgeConfig/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void activate(ComponentContext context, Config config) throws Exception
this.config = config;

// Publish MQTT messages under the topic "edge/edge0/..."
this.topicPrefix = String.format(ControllerApiMqtt.TOPIC_PREFIX, config.clientId());
this.topicPrefix = createTopicPrefix(config);

super.activate(context, config.id(), config.alias(), config.enabled());
this.mqttConnector.connect(config.uri(), config.clientId(), config.username(), config.password(),
Expand All @@ -84,6 +84,31 @@ private void activate(ComponentContext context, Config config) throws Exception
});
}

/**
* Creates the topic prefix in either format.
*
* <ul>
* <li>topic_prefix/edge/edge_id/
* <li>edge/edge_id/
* </ul>
*
* @param config the {@link Config}
* @return the prefix
*/
protected static String createTopicPrefix(Config config) {
final var b = new StringBuilder();
if (config.topicPrefix() != null && !config.topicPrefix().isBlank()) {
b //
.append(config.topicPrefix()) //
.append("/");
}
b //
.append("edge/") //
.append(config.clientId()) //
.append("/");
return b.toString();
}

@Override
@Deactivate
protected void deactivate() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package io.openems.edge.controller.api.mqtt;

import static io.openems.edge.controller.api.mqtt.ControllerApiMqttImpl.createTopicPrefix;
import static org.junit.Assert.assertEquals;

import java.time.Instant;
import java.time.ZoneOffset;

Expand All @@ -25,6 +28,7 @@ public void test() throws Exception {
.activate(MyConfig.create() //
.setId(CTRL_ID) //
.setClientId("edge0") //
.setTopicPrefix("") //
.setUsername("guest") //
.setPassword("guest") //
.setUri("ws://localhost:1883") //
Expand All @@ -36,4 +40,19 @@ public void test() throws Exception {
.build());
}

@Test
public void testCreateTopicPrefix() throws Exception {
assertEquals("foo/bar/edge/edge0/", createTopicPrefix(MyConfig.create() //
.setClientId("edge0") //
.setTopicPrefix("foo/bar") //
.build()));
assertEquals("edge/edge0/", createTopicPrefix(MyConfig.create() //
.setClientId("edge0") //
.setTopicPrefix("") //
.build()));
assertEquals("edge/edge0/", createTopicPrefix(MyConfig.create() //
.setClientId("edge0") //
.setTopicPrefix(null) //
.build()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ protected static class Builder {
private PersistencePriority persistencePriority;
private boolean debugMode;
private String clientId;
private String topicPrefix;
private String username;
private String password;
private String certPem;
Expand All @@ -36,6 +37,11 @@ public Builder setClientId(String clientId) {
return this;
}

public Builder setTopicPrefix(String topicPrefix) {
this.topicPrefix = topicPrefix;
return this;
}

public Builder setUsername(String username) {
this.username = username;
return this;
Expand Down Expand Up @@ -112,6 +118,11 @@ public String clientId() {
return this.builder.clientId;
}

@Override
public String topicPrefix() {
return this.builder.topicPrefix;
}

@Override
public String username() {
return this.builder.username;
Expand Down
8 changes: 4 additions & 4 deletions io.openems.wrapper/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Bundle-Description: This wraps external java libraries that do not have OSGi hea
com.influxdb:flux-dsl;version='6.12.0',\
com.squareup.okhttp3:logging-interceptor;version='4.12.0',\
com.squareup.okhttp3:okhttp;version='4.12.0',\
com.squareup.retrofit2:retrofit;version='2.10.0',\
com.squareup.retrofit2:converter-gson;version='2.10.0',\
com.squareup.retrofit2:converter-scalars;version='2.10.0',\
com.squareup.retrofit2:adapter-rxjava3;version='2.10.0',\
com.squareup.retrofit2:retrofit;version='2.11.0',\
com.squareup.retrofit2:converter-gson;version='2.11.0',\
com.squareup.retrofit2:converter-scalars;version='2.11.0',\
com.squareup.retrofit2:adapter-rxjava3;version='2.11.0',\
com.sun.activation.javax.activation;version='1.2.0',\
eu.chargetime.ocpp:OCPP-J;version='1.0.2',\
eu.chargetime.ocpp:common;version='1.0.2',\
Expand Down
6 changes: 3 additions & 3 deletions io.openems.wrapper/retrofit-adapter-rxjava3.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# NOTE: At runtime Retrofit throws a not so nice warning:
#
# WARNING: An illegal reflective access operation has occurred
# WARNING: Illegal reflective access by retrofit2.Platform (file:.../.gradle/caches/.../retrofit-2.10.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
# WARNING: Illegal reflective access by retrofit2.Platform (file:.../.gradle/caches/.../retrofit-2.11.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
# WARNING: Please consider reporting this to the maintainers of retrofit2.Platform
# WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
# WARNING: All illegal access operations will be denied in a future release
Expand All @@ -14,10 +14,10 @@ Bundle-Name: retrofit-adapter-rxjava3
Bundle-Description: A type-safe HTTP client for Android and Java
Bundle-DocURL: https://github.com/google/gson
Bundle-License: https://opensource.org/licenses/Apache-2.0
Bundle-Version: 2.10.0
Bundle-Version: 2.11.0

Include-Resource: \
@adapter-rxjava3-2.10.0.jar,\
@adapter-rxjava3-2.11.0.jar,\

Export-Package: \
retrofit2.adapter.rxjava3,\
Expand Down
4 changes: 2 additions & 2 deletions io.openems.wrapper/retrofit-converter-gson.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Bundle-Name: retrofit-converter-gson
Bundle-Description: A type-safe HTTP client for Android and Java
Bundle-DocURL: https://github.com/google/gson
Bundle-License: https://opensource.org/licenses/Apache-2.0
Bundle-Version: 2.10.0
Bundle-Version: 2.11.0

Include-Resource: \
@converter-gson-2.10.0.jar,\
@converter-gson-2.11.0.jar,\

Export-Package: \
retrofit2.converter.gson,\
Expand Down
4 changes: 2 additions & 2 deletions io.openems.wrapper/retrofit-converter-scalars.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Bundle-Name: retrofit-converter-scalars
Bundle-Description: A type-safe HTTP client for Android and Java
Bundle-DocURL: https://github.com/google/gson
Bundle-License: https://opensource.org/licenses/Apache-2.0
Bundle-Version: 2.10.0
Bundle-Version: 2.11.0

Include-Resource: \
@converter-scalars-2.10.0.jar,\
@converter-scalars-2.11.0.jar,\

Export-Package: \
retrofit2.converter.scalars,\
Expand Down
6 changes: 3 additions & 3 deletions io.openems.wrapper/retrofit2.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# NOTE: At runtime Retrofit throws a not so nice warning:
#
# WARNING: An illegal reflective access operation has occurred
# WARNING: Illegal reflective access by retrofit2.Platform (file:.../.gradle/caches/.../retrofit-2.10.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
# WARNING: Illegal reflective access by retrofit2.Platform (file:.../.gradle/caches/.../retrofit-2.11.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
# WARNING: Please consider reporting this to the maintainers of retrofit2.Platform
# WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
# WARNING: All illegal access operations will be denied in a future release
Expand All @@ -14,10 +14,10 @@ Bundle-Name: retrofit
Bundle-Description: A type-safe HTTP client for Android and Java
Bundle-DocURL: https://github.com/google/gson
Bundle-License: https://opensource.org/licenses/Apache-2.0
Bundle-Version: 2.10.0
Bundle-Version: 2.11.0

Include-Resource: \
@retrofit-2.10.0.jar,\
@retrofit-2.11.0.jar,\

Export-Package: \
retrofit2,\
Expand Down
6 changes: 4 additions & 2 deletions tools/gitpod/openems-backend/config.d/Edge/Websocket.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
:org.apache.felix.configadmin.revision:=L"1"
:org.apache.felix.configadmin.revision:=L"3"
debugMode="OFF"
poolSize=I"10"
port=I"8081"
service.pid="Edge.Websocket"
service.pid="Edge.Websocket"
15 changes: 12 additions & 3 deletions tools/gitpod/openems-backend/config.d/Metadata/Odoo.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
:org.apache.felix.configadmin.revision:=L"1"
:org.apache.felix.configadmin.revision:=L"2"
database="prod"
pgUser="gitpod"
service.pid="Metadata.Odoo"
debugMode="OFF"
odooHost="localhost"
odooPassword="admin"
odooPort=I"8069"
odooProtocol="HTTP"
odooUid=I"2"
pgConnectionPoolSize=I"40"
pgHost="localhost"
pgPassword=""
pgPort=I"5432"
pgUser="gitpod"
poolSize=I"30"
service.pid="Metadata.Odoo"
6 changes: 4 additions & 2 deletions tools/gitpod/openems-backend/config.d/Ui/Websocket.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
:org.apache.felix.configadmin.revision:=L"1"
:org.apache.felix.configadmin.revision:=L"2"
debugMode="OFF"
poolSize=I"10"
port=I"8082"
service.pid="Ui.Websocket"
service.pid="Ui.Websocket"
12 changes: 10 additions & 2 deletions tools/gitpod/openems-backend/config.d/org/ops4j/pax/logging.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
:org.apache.felix.configadmin.revision:=L"1"
_felix_.cm.newConfiguration=B"true"
service.pid="org.ops4j.pax.logging"
log4j2.appender.console.layout.pattern="%d{ISO8601}\ [%-8.8t]\ %-5p\ [%-30.30c]\ %m%n"
log4j2.appender.console.layout.type="PatternLayout"
log4j2.appender.console.name="console"
log4j2.appender.console.type="Console"
log4j2.appender.paxosgi.name="paxosgi"
log4j2.appender.paxosgi.type="PaxOsgi"
log4j2.rootLogger.appenderRef.console.ref="console"
log4j2.rootLogger.appenderRef.paxosgi.ref="paxosgi"
log4j2.rootLogger.level="INFO"
service.pid="org.ops4j.pax.logging"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
org.ops4j.pax.logging="jar/pax-logging-log4j1-2.0.5.jar"
org.ops4j.pax.logging="jar/pax-logging-log4j2-2.2.1.jar
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:org.apache.felix.configadmin.revision:=L"3"
Component.target="(&(enabled\=true)(!(service.pid\=Controller.Api.ModbusTcp.ReadOnly.17b969c5-fd9f-4cc3-9fba-fe7f41ff7146))(|(id\=_sum)))"
:org.apache.felix.configadmin.revision:=L"4"
Component.target="(&(!(service.pid\=Controller.Api.ModbusTcp.ReadOnly.17b969c5-fd9f-4cc3-9fba-fe7f41ff7146))(|(id\=_sum)))"
_lastChangeAt="2020-09-15T19:21:03"
_lastChangeBy="UNDEFINED"
alias=""
Expand All @@ -11,4 +11,4 @@ id="ctrlApiModbusTcp0"
maxConcurrentConnections=I"5"
port=I"502"
service.factoryPid="Controller.Api.ModbusTcp.ReadOnly"
service.pid="Controller.Api.ModbusTcp.ReadOnly.17b969c5-fd9f-4cc3-9fba-fe7f41ff7146"
service.pid="Controller.Api.ModbusTcp.ReadOnly.17b969c5-fd9f-4cc3-9fba-fe7f41ff7146"
Loading

0 comments on commit 5ac117c

Please sign in to comment.