Skip to content

Commit

Permalink
Merge pull request #8 from ww24/fix/api-error-handling
Browse files Browse the repository at this point in the history
fix name
  • Loading branch information
ww24 authored Dec 23, 2016
2 parents f5dc3d1 + b42308e commit 27c18c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"net/http"
"strings"

"github.com/labstack/echo"
"github.com/ww24/lirc-web-api/lirc"
Expand Down Expand Up @@ -83,10 +84,13 @@ func fetchSignals() (signals []signal, err error) {
}

for _, reply := range replies {
signals = append(signals, signal{
Remote: remote,
Name: reply,
})
name := strings.Split(reply, " ")
if len(name) == 2 {
signals = append(signals, signal{
Remote: remote,
Name: name[1],
})
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion wercker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build:
steps:
- script:
name: set API_VERSION
code: export API_VERSION="v0.2.0"
code: export API_VERSION="v0.2.1"

- install-packages:
packages: lirc
Expand Down

0 comments on commit 27c18c0

Please sign in to comment.