Skip to content

Commit

Permalink
Update homehub-client to v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnetherton committed Apr 5, 2017
1 parent b76020e commit bd54b28
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 15 deletions.
6 changes: 3 additions & 3 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import:
version: ~1.4.0
- package: github.com/bgentry/speakeasy
- package: github.com/jamesnetherton/homehub-client
version: ~0.3.0
version: ~0.4.0
27 changes: 27 additions & 0 deletions homehub-cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,33 @@ func initCommands() []cmd.Command {
Name: "BandwidthMonitor",
Description: "Creates a new Home Hub login session",
Exec: func(args []string) (result interface{}, err error) { return service.GetHub().BandwidthMonitor() },
PostExec: func(result interface{}, err error) error {
if err == nil {
headerPattern := "%-30s%-20s%-25s%-7s\n"
dataPattern := "%-30s%-20s%-25d%-7d\n"
bandwidthLog := result.(*homehub.BandwidthLog)
bandwidthLogEntries := bandwidthLog.Entries

fmt.Print("\n")
fmt.Printf(headerPattern, "------------------", "----------", "----------", "--------")
fmt.Printf(headerPattern, " MAC Address ", " Date ", "Downloaded", "Uploaded")
fmt.Printf(headerPattern, "------------------", "----------", "----------", "--------")

for i := 0; i < len(bandwidthLogEntries); i++ {
fmt.Printf(dataPattern,
bandwidthLogEntries[i].MACAddress,
bandwidthLogEntries[i].Date,
bandwidthLogEntries[i].DownloadMegabytes,
bandwidthLogEntries[i].UploadMegabytes,
)
}

fmt.Print("\n")

return nil
}
return err
},
},
AuthenticatingCommand: login,
}
Expand Down
1 change: 1 addition & 0 deletions matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

| CLI Version | Supported Firmware Version |
|----------------|------------------|
|v0.3.0|SG4B10002244|
|v0.2.0|SG4B10002244|
|v0.1.0|SG4B10002244|
|v0.0.2|SG4B100021EC|
Expand Down
48 changes: 48 additions & 0 deletions vendor/github.com/jamesnetherton/homehub-client/bandwidth_log.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions vendor/github.com/jamesnetherton/homehub-client/hub.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 44 additions & 6 deletions vendor/github.com/jamesnetherton/homehub-client/hub_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/github.com/jamesnetherton/homehub-client/matrix.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd54b28

Please sign in to comment.