Skip to content

Commit

Permalink
mqtt component support
Browse files Browse the repository at this point in the history
  • Loading branch information
jcodybaker committed Feb 24, 2024
1 parent 1d9d23f commit 89d3147
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21.3
require (
github.com/go-logr/zerologr v1.2.3
github.com/hashicorp/mdns v1.0.5
github.com/jcodybaker/go-shelly v0.0.0-20240219140957-2c218acd78c7
github.com/jcodybaker/go-shelly v0.0.0-20240224194430-0dd7eb74d25c
github.com/mongoose-os/mos v0.0.0-20230313140341-b44964e63a92
github.com/prometheus/client_golang v1.18.0
github.com/rs/zerolog v1.31.0
Expand Down
30 changes: 30 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,36 @@ github.com/jcodybaker/go-shelly v0.0.0-20240219140359-35a1ee3d618d h1:SRztP7mDD2
github.com/jcodybaker/go-shelly v0.0.0-20240219140359-35a1ee3d618d/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240219140957-2c218acd78c7 h1:M8JHRruTCk+Vu5YHpkkk1v2dGdocjZAWpvfa+49+q0I=
github.com/jcodybaker/go-shelly v0.0.0-20240219140957-2c218acd78c7/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224175454-b8176369ee1b h1:HBCPix6yvb60XJ1eFiiJpFquZaSzJZ1IcozRC1TaScw=
github.com/jcodybaker/go-shelly v0.0.0-20240224175454-b8176369ee1b/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224180133-3ee05d407bf2 h1:cvCrmDSY7n1yu0wYmDJuEk1DRD8VkhuxMoxaeJokYXw=
github.com/jcodybaker/go-shelly v0.0.0-20240224180133-3ee05d407bf2/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224180803-4edb1faf012a h1:Mqm8ujML0/m6Ee7Jw9yeUSP/8dhnr2gJW79iPHwUyxk=
github.com/jcodybaker/go-shelly v0.0.0-20240224180803-4edb1faf012a/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224181037-2b8548529dfb h1:Yo8lmxgfm808aNHD0GpYJnw0Q1tJ1ynFTT8F6DoXyBI=
github.com/jcodybaker/go-shelly v0.0.0-20240224181037-2b8548529dfb/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224183213-30bbdfb436b4 h1:gcQ9DF78f2mCUEIXU3UuSoIFdhzapicl4jIK1HaLllw=
github.com/jcodybaker/go-shelly v0.0.0-20240224183213-30bbdfb436b4/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224183651-a29b95b20a9a h1:MYd4q35+e68dDNXDlqXU2+6pVHaX+pOdG4kWh8JagvQ=
github.com/jcodybaker/go-shelly v0.0.0-20240224183651-a29b95b20a9a/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224184238-998089353c3b h1:geppg3Jv/BKEBRez5u0UqKAJEv2SkF8yQ3kyrtc3sZE=
github.com/jcodybaker/go-shelly v0.0.0-20240224184238-998089353c3b/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224190414-b494a63e0ea5 h1:Oow2Z4vD2PmM2zzYQmi9EV7G13OTk5295ysfP0HEKTQ=
github.com/jcodybaker/go-shelly v0.0.0-20240224190414-b494a63e0ea5/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224190626-5e2e9ee0235f h1:f+yot+dJCOjHuygdeXkXkvrKbfXqZWAC5LunH5Gfgt0=
github.com/jcodybaker/go-shelly v0.0.0-20240224190626-5e2e9ee0235f/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224191202-72fa3a889b63 h1:T8FT5La++ciKaKQM3M6HAeol7DLkMxt+2Ojk8w5AuvI=
github.com/jcodybaker/go-shelly v0.0.0-20240224191202-72fa3a889b63/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224191740-01b5922c10b0 h1:BkcqANYb5BXnpXt7mImAmii5pMvPvtM+/s5G3sw+raw=
github.com/jcodybaker/go-shelly v0.0.0-20240224191740-01b5922c10b0/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224192923-40f311470ddd h1:0tAsEHWm5oLG1ksuc/a03wL/rNyY5AcWuDSogCS03VE=
github.com/jcodybaker/go-shelly v0.0.0-20240224192923-40f311470ddd/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224193737-f3d6ab9c834d h1:V6PFgw9WDz6Or5CpiSx+O1/qApBGBJ2ENJ7Sn4xia+o=
github.com/jcodybaker/go-shelly v0.0.0-20240224193737-f3d6ab9c834d/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224194057-a319c99de268 h1:HASHwfNppg8HbD3ulKzxnleNxaJorxFwJt7hlU8DGpM=
github.com/jcodybaker/go-shelly v0.0.0-20240224194057-a319c99de268/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/go-shelly v0.0.0-20240224194430-0dd7eb74d25c h1:Vh5cN9CB1PhQRUZl9KLi3RTzmist95q/A45krHQ8keo=
github.com/jcodybaker/go-shelly v0.0.0-20240224194430-0dd7eb74d25c/go.mod h1:EfKnkqHSomR+wV7AoVgv6wU+kz1Xm4RSaEKaWMKWgWg=
github.com/jcodybaker/mdns v0.0.0-20240218225721-3b8606993b85 h1:/Ls0Q1POaNRFf9uopWlac5skKmWCkEwn/EPmueN5Mco=
github.com/jcodybaker/mdns v0.0.0-20240218225721-3b8606993b85/go.mod h1:RBWesCDwuRmyqepO+WxO8JSfrh3Tj3LkSzXPQlFq2nM=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
Expand Down
10 changes: 10 additions & 0 deletions pkg/gencobra/gencobra.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ func newFlagReader(f *pflag.FlagSet, method string) fieldFunc {
var s string
s, err = f.GetString(flagName)
fieldValue.SetString(s)
case reflect.TypeOf(shelly.MQTT_SSL_CA("")):
var s string
s, err = f.GetString(flagName)
fieldValue.Set(reflect.ValueOf(shelly.MQTT_SSL_CA(s)))
case reflect.TypeOf(shelly.NewNullString("")):
var s string
if f.Changed(flagName) {
s, err = f.GetString(flagName)
fieldValue.Set(reflect.ValueOf(shelly.NewNullString(s)))
}
case reflect.TypeOf((*string)(nil)):
var s string
s, err = f.GetString(flagName)
Expand Down

0 comments on commit 89d3147

Please sign in to comment.