From 4ca29fe497471e35b3a4ed7fa05bc2760f7f6139 Mon Sep 17 00:00:00 2001 From: Barnaby Gray Date: Sun, 3 Apr 2016 09:19:58 +0100 Subject: [PATCH] Add status to discover. --- client.go | 4 ++++ cmd/cast/main.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 5ff5454..51f5932 100644 --- a/client.go +++ b/client.go @@ -71,6 +71,10 @@ func (c *Client) Device() string { return c.info["md"] } +func (c *Client) Status() string { + return c.info["rs"] +} + func (c *Client) String() string { return fmt.Sprintf("%s - %s:%d", c.name, c.host, c.port) } diff --git a/cmd/cast/main.go b/cmd/cast/main.go index 40e425d..bd21785 100644 --- a/cmd/cast/main.go +++ b/cmd/cast/main.go @@ -233,7 +233,7 @@ func discoverCommand(c *cli.Context) { found := map[string]bool{} for client := range discover.Found() { if _, ok := found[client.Uuid()]; !ok { - fmt.Printf("Found: %s:%d '%s' (%s)\n", client.IP(), client.Port(), client.Name(), client.Device()) + fmt.Printf("Found: %s:%d '%s' (%s) %s\n", client.IP(), client.Port(), client.Name(), client.Device(), client.Status()) found[client.Uuid()] = true } }