Skip to content

Commit

Permalink
fix post param
Browse files Browse the repository at this point in the history
  • Loading branch information
nitram509 committed Oct 10, 2024
1 parent 7ec1468 commit 2d1c960
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion poe_cycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (poe *PoeCyclePowerCommand) cyclePowerGs316EPx(args *GlobalOptions) error {
}
urlStr := fmt.Sprintf("http://%s/iss/specific/poePortConf.html", poe.Address)
reqForm := url.Values{}
reqForm.Add("type", "resetPoe")
reqForm.Add("TYPE", "resetPoe")
reqForm.Add("PoePort", createPortResetPayloadGs316EPx(poe.Ports))
reqForm.Add("Gambit", token)
result, err := postPage(args, poe.Address, urlStr, reqForm.Encode())
Expand Down
3 changes: 3 additions & 0 deletions poe_cycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ import (
func TestPoePortReset(t *testing.T) {
s := createPortResetPayloadGs316EPx([]int{3, 5})
then.AssertThat(t, s, is.EqualTo("0010100000000000"))

s = createPortResetPayloadGs316EPx([]int{1})
then.AssertThat(t, s, is.EqualTo("1000000000000000"))
}

0 comments on commit 2d1c960

Please sign in to comment.