Skip to content

Commit

Permalink
hdhr device ids are alpha numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed May 6, 2019
1 parent 0d28df6 commit 3c289e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Here's an example configuration file. **You will need to create this file.** It
# THIS SECTION IS REQUIRED ########################################################################
[Discovery] # most likely you won't need to change anything here
Device-Auth = "telly123" # These settings are all related to how telly identifies
Device-ID = 12345678 # itself to Plex.
Device-ID = "12345678" # itself to Plex.
Device-UUID = ""
Device-Firmware-Name = "hdhomeruntc_atsc"
Device-Firmware-Version = "20150826"
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var (
func main() {

// Discovery flags
flag.Int("discovery.device-id", 12345678, "8 digits used to uniquely identify the device. $(TELLY_DISCOVERY_DEVICE_ID)")
flag.String("discovery.device-id", "12345678", "8 alpha-numeric characters used to uniquely identify the device. $(TELLY_DISCOVERY_DEVICE_ID)")
flag.String("discovery.device-friendly-name", "telly", "Name exposed via discovery. Useful if you are running two instances of telly and want to differentiate between them $(TELLY_DISCOVERY_DEVICE_FRIENDLY_NAME)")
flag.String("discovery.device-auth", "telly123", "Only change this if you know what you're doing $(TELLY_DISCOVERY_DEVICE_AUTH)")
flag.String("discovery.device-manufacturer", "Silicondust", "Manufacturer exposed via discovery. $(TELLY_DISCOVERY_DEVICE_MANUFACTURER)")
Expand Down Expand Up @@ -154,7 +154,7 @@ func main() {
validateConfig()

viper.Set("discovery.device-friendly-name", fmt.Sprintf("HDHomerun (%s)", viper.GetString("discovery.device-friendly-name")))
viper.Set("discovery.device-uuid", fmt.Sprintf("%d-AE2A-4E54-BBC9-33AF7D5D6A92", viper.GetInt("discovery.device-id")))
viper.Set("discovery.device-uuid", fmt.Sprintf("%d-AE2A-4E54-BBC9-33AF7D5D6A92", viper.GetString("discovery.device-id")))

if log.Level == logrus.DebugLevel {
js, jsErr := json.MarshalIndent(viper.AllSettings(), "", " ")
Expand Down
3 changes: 1 addition & 2 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"fmt"
"net"
"strconv"

"github.com/spf13/viper"
)
Expand All @@ -24,7 +23,7 @@ func getDiscoveryData() DiscoveryData {
FirmwareName: viper.GetString("discovery.device-firmware-name"),
TunerCount: viper.GetInt("iptv.streams"),
FirmwareVersion: viper.GetString("discovery.device-firmware-version"),
DeviceID: strconv.Itoa(viper.GetInt("discovery.device-id")),
DeviceID: viper.GetString("discovery.device-id"),
DeviceAuth: viper.GetString("discovery.device-auth"),
BaseURL: fmt.Sprintf("http://%s", viper.GetString("web.base-address")),
LineupURL: fmt.Sprintf("http://%s/lineup.json", viper.GetString("web.base-address")),
Expand Down

0 comments on commit 3c289e8

Please sign in to comment.