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

Tapo: Enable KLAP protocol + P100 devices #10606

Merged
merged 25 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions charger/tapo.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,12 @@ func NewTapo(embed embed, uri, user, password string, standbypower float64) (*Ta

// Enabled implements the api.Charger interface
func (c *Tapo) Enabled() (bool, error) {
resp, err := c.conn.ExecCmd("get_device_info", false)
if err != nil {
return false, err
}
return resp.Result.DeviceON, nil
return c.conn.Enabled()
}

// Enable implements the api.Charger interface
func (c *Tapo) Enable(enable bool) error {
_, err := c.conn.ExecCmd("set_device_info", enable)
return err
return c.conn.Enable(enable)
}

var _ api.ChargeRater = (*Tapo)(nil)
Expand Down
8 changes: 6 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/evcc-io/evcc

go 1.21
go 1.21.1

toolchain go1.21.3

require (
dario.cat/mergo v1.0.0
Expand Down Expand Up @@ -47,6 +49,7 @@ require (
github.com/hashicorp/go-version v1.6.0
github.com/hasura/go-graphql-client v0.10.0
github.com/influxdata/influxdb-client-go/v2 v2.12.5-0.20231103130105-12eadbdbefaf
github.com/insomniacslk/tapo v0.0.0-20231102105048-52dbe7a83ca7
github.com/itchyny/gojq v0.12.13
github.com/jeremywohl/flatten v1.0.1
github.com/jinzhu/copier v0.4.0
Expand All @@ -63,7 +66,6 @@ require (
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40
github.com/mabunixda/wattpilot v1.6.2
github.com/manifoldco/promptui v0.9.0
github.com/mergermarket/go-pkcs7 v0.0.0-20170926155232-153b18ea13c9
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.5.0
github.com/mlnoga/rct v0.1.2-0.20230731074838-03eacb926f99
Expand Down Expand Up @@ -140,6 +142,7 @@ require (
github.com/imdario/mergo v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect
github.com/insomniacslk/xjson v0.0.0-20231023101448-2249e546a131 // indirect
github.com/itchyny/timefmt-go v0.1.5 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand All @@ -151,6 +154,7 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mergermarket/go-pkcs7 v0.0.0-20170926155232-153b18ea13c9 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/miekg/dns v1.1.56 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,10 @@ github.com/influxdata/influxdb-client-go/v2 v2.12.5-0.20231103130105-12eadbdbefa
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf h1:7JTmneyiNEwVBOHSjoMxiWAqB992atOeepeFYegn5RU=
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/insomniacslk/tapo v0.0.0-20231102105048-52dbe7a83ca7 h1:HqhTgNBPK6hxSV2Ib+7bZUWNdsIlydgc3Q0T06pEbJc=
github.com/insomniacslk/tapo v0.0.0-20231102105048-52dbe7a83ca7/go.mod h1:Ac/4L4hAA14H3yYtFk/ZfgpYZ7knJhNuNKmGl/+YDik=
github.com/insomniacslk/xjson v0.0.0-20231023101448-2249e546a131 h1:bVGPuMhjgFtxVdQGfYnFq+EnCqArOAjLNciow/nArwE=
github.com/insomniacslk/xjson v0.0.0-20231023101448-2249e546a131/go.mod h1:Z4EVr4bVv9LZbbje9xyZEyOLpdCOmCvr5S9BJtrdTfw=
github.com/itchyny/gojq v0.12.13 h1:IxyYlHYIlspQHHTE0f3cJF0NKDMfajxViuhBLnHd/QU=
github.com/itchyny/gojq v0.12.13/go.mod h1:JzwzAqenfhrPUuwbmEz3nu3JQmFLlQTQMUcOdnu/Sf4=
github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE=
Expand Down
Loading