Skip to content

Commit 93c5dd5

Browse files
bump
1 parent 191a839 commit 93c5dd5

File tree

3 files changed

+46
-43
lines changed

3 files changed

+46
-43
lines changed

cmd/kasa/main.go

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func main() {
6161
UsageText: "kasa info host",
6262
ArgsUsage: "host",
6363
Arguments: []cli.Argument{
64-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
64+
&cli.StringArg{Name: "host", Destination: &host},
6565
},
6666
Action: func(ctx context.Context, cmd *cli.Command) error {
6767
k, err := getKasaDevice(cmd)
@@ -100,7 +100,7 @@ func main() {
100100
UsageText: "kasa status host",
101101
ArgsUsage: "host",
102102
Arguments: []cli.Argument{
103-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
103+
&cli.StringArg{Name: "host", Destination: &host},
104104
},
105105
Action: func(ctx context.Context, cmd *cli.Command) error {
106106
k, err := getKasaDevice(cmd)
@@ -127,8 +127,8 @@ func main() {
127127
UsageText: "kasa brightness host (value: 0-100)",
128128
ArgsUsage: "host brightness",
129129
Arguments: []cli.Argument{
130-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
131-
&cli.StringArg{Name: "brightness", Min: 1, Max: 1, Destination: &value},
130+
&cli.StringArg{Name: "host", Destination: &host},
131+
&cli.StringArg{Name: "brightness", Destination: &value},
132132
},
133133
Action: func(ctx context.Context, cmd *cli.Command) error {
134134
k, err := getKasaDevice(cmd)
@@ -155,7 +155,7 @@ func main() {
155155
UsageText: "kasa nocloud host",
156156
ArgsUsage: "host",
157157
Arguments: []cli.Argument{
158-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
158+
&cli.StringArg{Name: "host", Destination: &host},
159159
},
160160
Action: func(ctx context.Context, cmd *cli.Command) error {
161161
k, err := getKasaDevice(cmd)
@@ -171,7 +171,7 @@ func main() {
171171
UsageText: "kasa cloud host username password",
172172
ArgsUsage: "host",
173173
Arguments: []cli.Argument{
174-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
174+
&cli.StringArg{Name: "host", Destination: &host},
175175
},
176176
Action: func(ctx context.Context, cmd *cli.Command) error {
177177
k, err := getKasaDevice(cmd)
@@ -186,8 +186,8 @@ func main() {
186186
Usage: "toggle a relay's state",
187187
ArgsUsage: "[-c child ID] host true|false",
188188
Arguments: []cli.Argument{
189-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
190-
&cli.StringArg{Name: "state", Min: 1, Max: 1, Destination: &value},
189+
&cli.StringArg{Name: "host", Destination: &host},
190+
&cli.StringArg{Name: "state", Destination: &value},
191191
},
192192
Action: func(ctx context.Context, cmd *cli.Command) error {
193193
b, err := strconv.ParseBool(value)
@@ -210,8 +210,8 @@ func main() {
210210
Usage: "disable status LED",
211211
ArgsUsage: "host true|false",
212212
Arguments: []cli.Argument{
213-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
214-
&cli.StringArg{Name: "state", Min: 1, Max: 1, Destination: &value},
213+
&cli.StringArg{Name: "host", Destination: &host},
214+
&cli.StringArg{Name: "state", Destination: &value},
215215
},
216216
Action: func(ctx context.Context, cmd *cli.Command) error {
217217
b, err := strconv.ParseBool(value)
@@ -260,8 +260,8 @@ func main() {
260260
Usage: "adjust device countdowns",
261261
ArgsUsage: "host [delete]",
262262
Arguments: []cli.Argument{
263-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
264-
&cli.StringArg{Name: "delete", Min: 0, Max: 1, Destination: &value},
263+
&cli.StringArg{Name: "host", Destination: &host},
264+
&cli.StringArg{Name: "delete", Destination: &value},
265265
},
266266
Action: func(ctx context.Context, cmd *cli.Command) error {
267267
k, err := getKasaDevice(cmd)
@@ -286,7 +286,7 @@ func main() {
286286
Usage: "reboot device",
287287
ArgsUsage: "host",
288288
Arguments: []cli.Argument{
289-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
289+
&cli.StringArg{Name: "host", Destination: &host},
290290
},
291291
Action: func(ctx context.Context, cmd *cli.Command) error {
292292
k, err := getKasaDevice(cmd)
@@ -302,8 +302,8 @@ func main() {
302302
Usage: "update device name (alias)",
303303
ArgsUsage: "host new-name",
304304
Arguments: []cli.Argument{
305-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
306-
&cli.StringArg{Name: "newname", Min: 1, Max: 1, Destination: &value},
305+
&cli.StringArg{Name: "host", Destination: &host},
306+
&cli.StringArg{Name: "newname", Destination: &value},
307307
},
308308
Action: func(ctx context.Context, cmd *cli.Command) error {
309309
k, err := getKasaDevice(cmd)
@@ -322,8 +322,8 @@ func main() {
322322
Usage: "send raw command",
323323
ArgsUsage: "host command",
324324
Arguments: []cli.Argument{
325-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
326-
&cli.StringArg{Name: "command", Min: 1, Max: 1, Destination: &value},
325+
&cli.StringArg{Name: "host", Destination: &host},
326+
&cli.StringArg{Name: "command", Destination: &value},
327327
},
328328
Action: func(ctx context.Context, cmd *cli.Command) error {
329329
k, err := getKasaDevice(cmd)
@@ -338,9 +338,9 @@ func main() {
338338
Usage: "configure wifi",
339339
ArgsUsage: "host ssid key",
340340
Arguments: []cli.Argument{
341-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
342-
&cli.StringArg{Name: "ssid", Min: 1, Max: 1, Destination: &value},
343-
&cli.StringArg{Name: "key", Min: 1, Max: 1, Destination: &secondary},
341+
&cli.StringArg{Name: "host", Destination: &host},
342+
&cli.StringArg{Name: "ssid", Destination: &value},
343+
&cli.StringArg{Name: "key", Destination: &secondary},
344344
},
345345
Action: func(ctx context.Context, cmd *cli.Command) error {
346346
k, err := getKasaDevice(cmd)
@@ -356,7 +356,7 @@ func main() {
356356
Usage: "check device wifi status",
357357
ArgsUsage: "host",
358358
Arguments: []cli.Argument{
359-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
359+
&cli.StringArg{Name: "host", Destination: &host},
360360
},
361361
Action: func(ctx context.Context, cmd *cli.Command) error {
362362
k, err := getKasaDevice(cmd)
@@ -376,9 +376,9 @@ func main() {
376376
Usage: "add device countdown",
377377
ArgsUsage: "host duration True|False",
378378
Arguments: []cli.Argument{
379-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
380-
&cli.StringArg{Name: "duration", Min: 1, Max: 1, Destination: &value},
381-
&cli.StringArg{Name: "target", Min: 1, Max: 1, Destination: &secondary},
379+
&cli.StringArg{Name: "host", Destination: &host},
380+
&cli.StringArg{Name: "duration", Destination: &value},
381+
&cli.StringArg{Name: "target", Destination: &secondary},
382382
},
383383
Action: func(ctx context.Context, cmd *cli.Command) error {
384384
k, err := getKasaDevice(cmd)
@@ -404,7 +404,7 @@ func main() {
404404
Usage: "remove coundown rules",
405405
ArgsUsage: "host",
406406
Arguments: []cli.Argument{
407-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
407+
&cli.StringArg{Name: "host", Destination: &host},
408408
},
409409
Action: func(ctx context.Context, cmd *cli.Command) error {
410410
k, err := getKasaDevice(cmd)
@@ -418,7 +418,7 @@ func main() {
418418
Name: "getcountdown",
419419
Usage: "view countdown rules",
420420
ArgsUsage: "host",
421-
Arguments: []cli.Argument{&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host}},
421+
Arguments: []cli.Argument{&cli.StringArg{Name: "host", Destination: &host}},
422422
Action: func(ctx context.Context, cmd *cli.Command) error {
423423
k, err := getKasaDevice(cmd)
424424
if err != nil {
@@ -437,7 +437,7 @@ func main() {
437437
Usage: "check dimmer parameters",
438438
ArgsUsage: "host",
439439
Arguments: []cli.Argument{
440-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
440+
&cli.StringArg{Name: "host", Destination: &host},
441441
},
442442
Action: func(ctx context.Context, cmd *cli.Command) error {
443443
k, err := getKasaDevice(cmd)
@@ -457,7 +457,7 @@ func main() {
457457
Usage: "check running rules",
458458
ArgsUsage: "host",
459459
Arguments: []cli.Argument{
460-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
460+
&cli.StringArg{Name: "host", Destination: &host},
461461
},
462462
Action: func(ctx context.Context, cmd *cli.Command) error {
463463
k, err := getKasaDevice(cmd)
@@ -477,8 +477,8 @@ func main() {
477477
Usage: "set operating mode",
478478
ArgsUsage: "host mode",
479479
Arguments: []cli.Argument{
480-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
481-
&cli.StringArg{Name: "mode", Min: 1, Max: 1, Destination: &value},
480+
&cli.StringArg{Name: "host", Destination: &host},
481+
&cli.StringArg{Name: "mode", Destination: &value},
482482
},
483483
Action: func(ctx context.Context, cmd *cli.Command) error {
484484
k, err := getKasaDevice(cmd)
@@ -541,8 +541,8 @@ func main() {
541541
Usage: "set fade on time",
542542
ArgsUsage: "time in ms",
543543
Arguments: []cli.Argument{
544-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
545-
&cli.StringArg{Name: "time", Min: 1, Max: 1, Destination: &value},
544+
&cli.StringArg{Name: "host", Destination: &host},
545+
&cli.StringArg{Name: "time", Destination: &value},
546546
},
547547
Action: func(ctx context.Context, cmd *cli.Command) error {
548548
k, err := getKasaDevice(cmd)
@@ -561,8 +561,8 @@ func main() {
561561
Usage: "set fade off time",
562562
ArgsUsage: "time in ms",
563563
Arguments: []cli.Argument{
564-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
565-
&cli.StringArg{Name: "time", Min: 1, Max: 1, Destination: &value},
564+
&cli.StringArg{Name: "host", Destination: &host},
565+
&cli.StringArg{Name: "time", Destination: &value},
566566
},
567567
Action: func(ctx context.Context, cmd *cli.Command) error {
568568
k, err := getKasaDevice(cmd)
@@ -581,8 +581,8 @@ func main() {
581581
Usage: "set gentle on time",
582582
ArgsUsage: "time in ms",
583583
Arguments: []cli.Argument{
584-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
585-
&cli.StringArg{Name: "time", Min: 1, Max: 1, Destination: &value},
584+
&cli.StringArg{Name: "host", Destination: &host},
585+
&cli.StringArg{Name: "time", Destination: &value},
586586
},
587587
Action: func(ctx context.Context, cmd *cli.Command) error {
588588
k, err := getKasaDevice(cmd)
@@ -601,8 +601,8 @@ func main() {
601601
Usage: "set gentle off time",
602602
ArgsUsage: "time in ms",
603603
Arguments: []cli.Argument{
604-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
605-
&cli.StringArg{Name: "time", Min: 1, Max: 1, Destination: &value},
604+
&cli.StringArg{Name: "host", Destination: &host},
605+
&cli.StringArg{Name: "time", Destination: &value},
606606
},
607607
Action: func(ctx context.Context, cmd *cli.Command) error {
608608
k, err := getKasaDevice(cmd)
@@ -621,9 +621,9 @@ func main() {
621621
Usage: "check energy usage",
622622
ArgsUsage: "host month year",
623623
Arguments: []cli.Argument{
624-
&cli.StringArg{Name: "host", Min: 1, Max: 1, Destination: &host},
625-
&cli.StringArg{Name: "month", Min: 0, Max: 1, Destination: &value},
626-
&cli.StringArg{Name: "year", Min: 0, Max: 1, Destination: &secondary},
624+
&cli.StringArg{Name: "host", Destination: &host},
625+
&cli.StringArg{Name: "month", Destination: &value},
626+
&cli.StringArg{Name: "year", Destination: &secondary},
627627
},
628628
Action: func(ctx context.Context, cmd *cli.Command) error {
629629
k, err := getKasaDevice(cmd)

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module github.com/cloudkucooland/go-kasa
22

3-
go 1.21
3+
go 1.22
44

5-
require github.com/urfave/cli/v3 v3.0.0-beta1
5+
require github.com/urfave/cli/v3 v3.4.1

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
44
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
55
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
66
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
7+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
78
github.com/urfave/cli/v3 v3.0.0-beta1 h1:6DTaaUarcM0wX7qj5Hcvs+5Dm3dyUTBbEwIWAjcw9Zg=
89
github.com/urfave/cli/v3 v3.0.0-beta1/go.mod h1:FnIeEMYu+ko8zP1F9Ypr3xkZMIDqW3DR92yUtY39q1Y=
10+
github.com/urfave/cli/v3 v3.4.1 h1:1M9UOCy5bLmGnuu1yn3t3CB4rG79Rtoxuv1sPhnm6qM=
11+
github.com/urfave/cli/v3 v3.4.1/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=
912
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
1013
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)