Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ShellyPlus1PM #2571

Merged
merged 13 commits into from
Jun 19, 2024
Merged

Conversation

Sn0w3y
Copy link
Contributor

@Sn0w3y Sn0w3y commented Mar 11, 2024

Example JSON:

{"ble":{},"cloud":{"connected":true},"input:0":{"id":0,"state":false},"mqtt":{"connected":false},"switch:0":{"id":0, "source":"init", "output":false, "apower":0.0, "voltage":231.3, "current":0.000, "aenergy":{"total":8629.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1708858380},"temperature":{"tC":44.3, "tF":111.7}},"sys":{"mac":"80646FE34998","restart_required":false,"time":"11:53","unixtime":1708858386,"uptime":150390,"ram_size":260364,"ram_free":115308,"fs_size":458752,"fs_free":143360,"cfg_rev":22,"kvs_rev":2,"schedule_rev":0,"webhook_rev":0,"available_updates":{},"reset_reason":3},"wifi":{"sta_ip":"192.168.178.169","status":"got ip","ssid":"heizung","rssi":-48,"ap_client_count":0},"ws":{"connected":false}}

Copy link

Code Coverage

Copy link

Code Coverage

Copy link

Code Coverage

Copy link

Code Coverage

Copy link

Code Coverage

Copy link
Contributor

@sfeilmeier sfeilmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitte nochmal überarbeiten 👍

@Sn0w3y
Copy link
Contributor Author

Sn0w3y commented Jun 2, 2024

@sfeilmeier ist erledigt, danke für den Hinweis ! :)

Copy link

github-actions bot commented Jun 2, 2024

Code Coverage

@Sn0w3y Sn0w3y requested a review from sfeilmeier June 2, 2024 18:45
Copy link

github-actions bot commented Jun 7, 2024

Code Coverage

Copy link

Code Coverage

Copy link

Code Coverage

private SinglePhase phase = null;
private String baseUrl;

private volatile Timedata timedata;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing @reference. This is always null.


@Override
public String debugLog() {
var b = new StringBuilder();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use Utils.generateDebugLog(this.getRelayChannel(), this.getActivePowerChannel())

if (this.phase != null) {
switch (this.phase) {
case L1:
this._setActivePowerL1(power);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No... we had discussed this for IO.Shelly.Plus.PlugS

this.logDebug(this.log, e.getMessage());
}

this._setRelay(relay0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be outside the brackets.

public void test() throws Exception {
new ComponentTest(new IoShellyPlus1PmImpl()) //
.addReference("httpBridgeFactory", DummyBridgeHttpFactory.ofDummyBridge()) //
.activate(MyConfig.create() //
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide full JUnit test, including parsing the JSON response

@sfeilmeier sfeilmeier merged commit 514d5d4 into OpenEMS:develop Jun 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants