Support mA current resolution adjustments (#646)
This commit is contained in:
parent
171c6f59fd
commit
3e23f50d69
1 changed files with 15 additions and 0 deletions
|
|
@ -247,6 +247,21 @@ func (c *Keba) MaxCurrent(current int64) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// MaxCurrentMillis implements the ChargerEx interface
|
||||
func (c *Keba) MaxCurrentMillis(current float64) error {
|
||||
d := int(1000 * current)
|
||||
|
||||
var resp string
|
||||
if err := c.roundtrip(fmt.Sprintf("curr %d", d), 0, &resp); err != nil {
|
||||
return err
|
||||
}
|
||||
if resp != keba.OK {
|
||||
return fmt.Errorf("curr %d unexpected response: %s", d, resp)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CurrentPower implements the Meter interface
|
||||
func (c *Keba) CurrentPower() (float64, error) {
|
||||
var kr keba.Report3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue