Skip to content

Commit

Permalink
Merge pull request #13 from fermayo/add-gen3-support
Browse files Browse the repository at this point in the history
Add support for gen3 devices
  • Loading branch information
fermayo authored Dec 8, 2024
2 parents e751cad + bf7f42b commit 3466c8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func updateShellyGen1(name, address string) {
}

func updateShellyGen2(name, address string) {
prefix := fmt.Sprintf("[%s/%s/gen2]", name, address)
prefix := fmt.Sprintf("[%s/%s/gen2+]", name, address)
// First, we trigger a check for updates
fmt.Printf("%s checking for updates...\n", prefix)
updates, err := makeGen2CheckForUpdateRequest(address)
Expand Down Expand Up @@ -268,8 +268,8 @@ func updateShellyGen2(name, address string) {
}

func updateShelly(name, address string, txtRecords []string, genToUpdate int) {
if slices.Contains(txtRecords, "gen=2") {
if genToUpdate == 2 || genToUpdate == 0 {
if slices.Contains(txtRecords, "gen=2") || slices.Contains(txtRecords, "gen=3") {
if genToUpdate == 2 || genToUpdate == 3 || genToUpdate == 0 {
updateShellyGen2(name, address)
}
return
Expand Down

0 comments on commit 3466c8a

Please sign in to comment.