From 71c3b66d97707d65959c0f5368f9e2b818fd0478 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 1 Jun 2017 19:30:36 +0200 Subject: [PATCH] fixed naming style --- README.md | 4 ++-- chromecast.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ec12528..2e009bf 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ Download the binary from [here](https://github.com/maxibanki/chromecast-socket-s | name | type | default value | description | |----|----|----|----| | name | string | Iknabixam Audio | Name of your chromecast device | -| scode| string | 10101 | Socket Code | -| sid | string | 00010 | Socket ID in binary format | +| SocketGroup| string | 10101 | Socket Group | +| SocketDevice | string | 00010 | Socket Device in binary format | | debug| bool | false | Enable debug logging | ## Usage: diff --git a/chromecast.go b/chromecast.go index 62598f1..25f71dc 100644 --- a/chromecast.go +++ b/chromecast.go @@ -28,9 +28,9 @@ type lastSwitchData struct { } type configuration struct { - DeviceName string - SocketCode string - SocketID string + DeviceName string + SocketGroup string + SocketDevice string } var ( @@ -40,8 +40,8 @@ var ( func main() { flag.StringVar(&config.DeviceName, "name", "Iknabixam Audio", "Name of your chromecast device") - flag.StringVar(&config.SocketCode, "scode", "10101", "Socket Code") - flag.StringVar(&config.SocketID, "sid", "00010", "Socket ID") + flag.StringVar(&config.SocketGroup, "sGroup", "10101", "Socket Group") + flag.StringVar(&config.SocketDevice, "sDevice", "00010", "Socket Device") flag.BoolVar(&log.Debug, "debug", false, "Enable debug logging") flag.Parse() @@ -150,11 +150,11 @@ func toggleSocket(mode bool) { func toggleSwitchDirectly(mode bool) { log.Printf("Switching the sockets: %t", mode) if mode { - if err := lastSwitch.rcSwitch.SwitchOn("", config.SocketCode, config.SocketID); err != nil { + if err := lastSwitch.rcSwitch.SwitchOn("", config.SocketGroup, config.SocketDevice); err != nil { log.Errorln(err) } } else { - if err := lastSwitch.rcSwitch.SwitchOff("", config.SocketCode, config.SocketID); err != nil { + if err := lastSwitch.rcSwitch.SwitchOff("", config.SocketGroup, config.SocketDevice); err != nil { log.Errorln(err) } }