Fix typos
This commit is contained in:
parent
cad5996571
commit
22d0600f4e
4 changed files with 7 additions and 7 deletions
|
|
@ -111,7 +111,7 @@ func (c *FritzDECT) Status() (api.ChargeStatus, error) {
|
|||
present, err = strconv.ParseInt(resp, 10, 64)
|
||||
}
|
||||
|
||||
// power value in 0,001 W (current switch power, refresh aproximately every 2 minutes)
|
||||
// power value in 0,001 W (current switch power, refresh approximately every 2 minutes)
|
||||
var power float64
|
||||
if err == nil {
|
||||
if resp, err = c.execFritzDectCmd("getswitchpower"); err == nil {
|
||||
|
|
@ -132,7 +132,7 @@ func (c *FritzDECT) Status() (api.ChargeStatus, error) {
|
|||
|
||||
// Enabled implements the api.Charger interface
|
||||
func (c *FritzDECT) Enabled() (bool, error) {
|
||||
// state 0/1 - DECT Switch state off/on (empty if unkown or error)
|
||||
// state 0/1 - DECT Switch state off/on (empty if unknown or error)
|
||||
resp, err := c.execFritzDectCmd("getswitchstate")
|
||||
|
||||
var state int64
|
||||
|
|
@ -150,7 +150,7 @@ func (c *FritzDECT) Enable(enable bool) error {
|
|||
cmd = "setswitchon"
|
||||
}
|
||||
|
||||
// state 0/1 - DECT Switch state off/on (empty if unkown or error)
|
||||
// state 0/1 - DECT Switch state off/on (empty if unknown or error)
|
||||
resp, err := c.execFritzDectCmd(cmd)
|
||||
|
||||
var state int64
|
||||
|
|
@ -179,7 +179,7 @@ var _ api.Meter = (*FritzDECT)(nil)
|
|||
|
||||
// CurrentPower implements the api.Meter interface
|
||||
func (c *FritzDECT) CurrentPower() (float64, error) {
|
||||
// power value in 0,001 W (current switch power, refresh aproximately every 2 minutes)
|
||||
// power value in 0,001 W (current switch power, refresh approximately every 2 minutes)
|
||||
resp, err := c.execFritzDectCmd("getswitchpower")
|
||||
|
||||
var power float64
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ func TestUnmarshalNiuToken(t *testing.T) {
|
|||
|
||||
func TestUnmarshalNiuResponse(t *testing.T) {
|
||||
var tok Response
|
||||
str := `{"data":{"isCharging":0,"lockStatus":0,"isAccOn":0,"isFortificationOn":0,"isConnected":true,"postion":{"lat":42.330353,"lng":11.450598},"hdop":1,"time":1617697890173,"batteries":{"compartmentA":{"bmsId":"bmsId","isConnected":true,"batteryCharging":59,"gradeBattery":"94.8"},"compartmentB":{"bmsId":"bmsId","isConnected":true,"batteryCharging":58,"gradeBattery":"95.9"}},"leftTime":"10.2","estimatedMileage":68,"gpsTimestamp":1617697890173,"infoTimestamp":1617697890173,"nowSpeed":0,"shakingValue":3,"locationType":1,"batteryDetail":true,"centreCtrlBattery":100,"ss_protocol_ver":3,"ss_online_sta":"1","gps":5,"gsm":14,"lastTrack":{"ridingTime":90,"distance":571,"time":1617269526360}},"desc":"成功","trace":"成功","status":0}`
|
||||
str := `{"data":{"isCharging":0,"lockStatus":0,"isAccOn":0,"isFortificationOn":0,"isConnected":true,"position":{"lat":42.330353,"lng":11.450598},"hdop":1,"time":1617697890173,"batteries":{"compartmentA":{"bmsId":"bmsId","isConnected":true,"batteryCharging":59,"gradeBattery":"94.8"},"compartmentB":{"bmsId":"bmsId","isConnected":true,"batteryCharging":58,"gradeBattery":"95.9"}},"leftTime":"10.2","estimatedMileage":68,"gpsTimestamp":1617697890173,"infoTimestamp":1617697890173,"nowSpeed":0,"shakingValue":3,"locationType":1,"batteryDetail":true,"centreCtrlBattery":100,"ss_protocol_ver":3,"ss_online_sta":"1","gps":5,"gsm":14,"lastTrack":{"ridingTime":90,"distance":571,"time":1617269526360}},"desc":"成功","trace":"成功","status":0}`
|
||||
|
||||
if err := json.Unmarshal([]byte(str), &tok); err != nil {
|
||||
t.Error(err)
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ func (v *Provider) request(uri string) (*http.Request, error) {
|
|||
return req, err
|
||||
}
|
||||
|
||||
// Status implements the vehicle status repsonse
|
||||
// Status implements the vehicle status response
|
||||
func (v *Provider) status(vin string) (interface{}, error) {
|
||||
uri := fmt.Sprintf("https://connect-portal.porsche.com/core/api/v3/de/de_DE/vehicles/%s", vin)
|
||||
req, err := v.request(uri)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ func (v *EMobilityProvider) request(uri string) (*http.Request, error) {
|
|||
return req, err
|
||||
}
|
||||
|
||||
// Status implements the vehicle status repsonse
|
||||
// Status implements the vehicle status response
|
||||
func (v *EMobilityProvider) status(vin string) (interface{}, error) {
|
||||
uri := fmt.Sprintf("https://api.porsche.com/service-vehicle/de/de_DE/e-mobility/J1/%s?timezone=Europe/Berlin", vin)
|
||||
req, err := v.request(uri)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue