-
Notifications
You must be signed in to change notification settings - Fork 397
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
Refactored Shelly 2.5 to use HttpBridge #2573
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.
Many topics appear over and over again in reviews. I believe we should eventually create an AbstractShelly class that combines all of the generic logic...
io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shelly25/IoShelly25.java
Outdated
Show resolved
Hide resolved
io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shelly25/IoShelly25.java
Outdated
Show resolved
Hide resolved
io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shelly25/IoShelly25Impl.java
Outdated
Show resolved
Hide resolved
io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shelly25/IoShelly25Impl.java
Outdated
Show resolved
Hide resolved
io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shelly25/IoShelly25Impl.java
Outdated
Show resolved
Hide resolved
io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shelly25/IoShelly25Impl.java
Outdated
Show resolved
Hide resolved
io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shelly25/IoShelly25Impl.java
Show resolved
Hide resolved
@sfeilmeier do you think it makes sense to sum up the meter Values and set _setActivePower(summedUpValues) for this Shelly ? |
1 similar comment
@sfeilmeier shoul be everything set now If we Merge all of the Shelly Impls i could start working on a Generic Shelly Class like Abstract it as we bespoke somehwhere |
this._setRelay1(relay1State.relayIsOn()); | ||
this._setRelay2(relay2State.relayIsOn()); | ||
|
||
this._setRelay1Overtemp(relay1State.overtemp()); |
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 potentially produces a NullPointerException
} else if (i == 1) { | ||
relay2State = parseRelay(JsonUtils.getAsJsonObject(relays.get(1))); | ||
} | ||
} | ||
this._setSlaveCommunicationFailed(false); |
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 is redundant/illogical
JsonElement jsonElement = JsonUtils.getAsJsonElement(result); | ||
final var relays = JsonUtils.getAsJsonArray(jsonElement, "relays"); | ||
|
||
for (int i = 0; i < 2; i++) { |
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 loop is not required
* | ||
* @return the Channel | ||
*/ | ||
public default BooleanWriteChannel getRelay2OverpowerChannel() { |
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 is not a WriteChannel.
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.
Leider waren immer noch sehr viele Programmierfehler im Code. Ich muss die Qualitätsanforderungen hoch halten, deshalb kann ich das dann so nicht einfach mergen. So kommen wir mit den Shellys leider nur langsam voran. Von umfangreichen JUnit-Tests (z. B. parsing tests für die JSON-Response) spreche ich noch gar nicht.
Diesen PR habe ich jetzt nochmal selbst einigermaßen bereinigt. Bitte schau dir mal meine Commits und Kommentare an.
No description provided.