Skip to content

Commit

Permalink
RCT: add external power
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Feb 27, 2023
1 parent 1f9361f commit 78e5119
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ require (
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.20230215163419-4242ff35a8ce
github.com/mlnoga/rct v0.1.2-0.20230227143934-71af1fb7dfa1
github.com/muka/go-bluetooth v0.0.0-20220219050759-674a63b8741a
github.com/mxschmitt/golang-combinations v1.1.0
github.com/nicksnyder/go-i18n/v2 v2.2.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,8 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mlnoga/rct v0.1.2-0.20230215163419-4242ff35a8ce h1:74Mw2TfstLVHfWkI6eg7TSxuchIwyUff9wQj6yLjMxY=
github.com/mlnoga/rct v0.1.2-0.20230215163419-4242ff35a8ce/go.mod h1:0lfd2mmBnBzIvuzYtdhG+2371u+cUfIxsYErm4P9KRI=
github.com/mlnoga/rct v0.1.2-0.20230227143934-71af1fb7dfa1 h1:+OVWP3tJu+en06qieaXY/pcX+1qKp4X1oX9g3hMgOCk=
github.com/mlnoga/rct v0.1.2-0.20230227143934-71af1fb7dfa1/go.mod h1:0lfd2mmBnBzIvuzYtdhG+2371u+cUfIxsYErm4P9KRI=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down
6 changes: 5 additions & 1 deletion meter/rct.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ func (m *RCT) CurrentPower() (float64, error) {
return 0, err
}
b, err := m.conn.QueryFloat32(rct.SolarGenBPowerW)
return float64(a + b), err
if err != nil {
return 0, err
}
c, err := m.conn.QueryFloat32(rct.S0ExternalPowerW)
return float64(a + b + c), err

case "battery":
res, err := m.conn.QueryFloat32(rct.BatteryPowerW)
Expand Down

0 comments on commit 78e5119

Please sign in to comment.