-
Notifications
You must be signed in to change notification settings - Fork 411
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
Implement ShellyPlus1PM #2571
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bitte nochmal überarbeiten 👍
io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shellyplus1pm/IoShellyPlus1PmImpl.java
Outdated
Show resolved
Hide resolved
@sfeilmeier ist erledigt, danke für den Hinweis ! :) |
private SinglePhase phase = null; | ||
private String baseUrl; | ||
|
||
private volatile Timedata timedata; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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() // |
There was a problem hiding this comment.
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
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}}