-
-
Notifications
You must be signed in to change notification settings - Fork 518
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
Pseudo charger/feature sync #936
Conversation
internal/charger/fritzdect.go
Outdated
// fetch basicdevicestats | ||
resp, err := c.execFritzDectCmd("getbasicdevicestats") | ||
if err != nil { | ||
return math.NaN(), err |
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.
ich geb immer 0 zurück. err zeigt an dass der Wert nicht gilt
internal/charger/fritzdect.go
Outdated
|
||
// unmarshal devicestats | ||
var statsresp fritzdect.Devicestats | ||
err = xml.Unmarshal([]byte(resp), &statsresp) |
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.
if err =...; err !=nil {
internal/charger/fritzdect.go
Outdated
} | ||
|
||
// select energy value of current day | ||
energylst := strings.Split(statsresp.Energy.Values[1], ",") |
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.
evergylist?
internal/charger/fritzdect.go
Outdated
// select energy value of current day | ||
energylst := strings.Split(statsresp.Energy.Values[1], ",") | ||
var energy float64 | ||
energy, err = strconv.ParseFloat(energylst[0], 64) |
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.
energy, err := ....
internal/charger/fritzdect/types.go
Outdated
|
||
import "encoding/xml" | ||
|
||
// getdevicestats command response (AHA-HTTP-Interface) |
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.
public in gross
Energy Energy `xml:"energy"` | ||
} | ||
|
||
type Energy struct { |
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.
Kommentar fehlt
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.
wirklich getbasicdevicesstats?
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.
internal/charger/tasmota.go
Outdated
|
||
// ChargedEnergy implements the api.ChargeRater interface | ||
func (c *Tasmota) ChargedEnergy() (float64, error) { | ||
var tStatusSNS tasmota.StatusSNSResponse |
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.
resp -> die heissen überall sonst auch so ;)
internal/charger/tasmota.go
Outdated
|
||
// Execute Tasmota Status 8 command | ||
err := c.GetJSON(c.cmdUri("Status 8"), &tStatusSNS) | ||
if err != nil { |
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.
weg- einfach unten err zurück geben
internal/charger/tasmota.go
Outdated
|
||
return int(1) == tStatus.Status.Power, err | ||
return int(1) == resp.Status.Power, err |
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.
warum nicht einfach resp.Status.Power == 1 ?
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.
ist wohl ein "Artefact" aus der Entwicklungsphase ...
internal/charger/tasmota.go
Outdated
func (c *Tasmota) ChargedEnergy() (float64, error) { | ||
var resp tasmota.StatusSNSResponse | ||
|
||
// Execute Tasmota Status 8 command |
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.
Inline Kommentare immer klein. Trägt der kommentar wirklich was zum Erkenntnisgewinn bei?
Dieser PR führt auch für die "pseudo" Charger FritzDect und Tasmato die ChargedEnergy Funktion auf Basis des in den Steckdosen mitgeschnittenen täglichen Energieverbrauchs ein.
Damit wären dann alle evcc "pseudo" Charger Feature-mäßig in sync.