Skip to content
This repository has been archived by the owner on Oct 13, 2019. It is now read-only.

Commit

Permalink
fixed naming style
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Jun 1, 2017
1 parent 9e9fad3 commit 71c3b66
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 7 additions & 7 deletions chromecast.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ type lastSwitchData struct {
}

type configuration struct {
DeviceName string
SocketCode string
SocketID string
DeviceName string
SocketGroup string
SocketDevice string
}

var (
Expand All @@ -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()

Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 71c3b66

Please sign in to comment.