fix(deps): update github.com/godbus/dbus/v5 digest to 6cc540d

Signed-off-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
renovate[bot]
2023-05-03 09:15:18 +00:00
committed by GitHub
parent 04c45cebcd
commit 999c620d5a
15 changed files with 247 additions and 143 deletions

View File

@@ -151,7 +151,14 @@ func (o *Object) StoreProperty(p string, value interface{}) error {
// SetProperty calls org.freedesktop.DBus.Properties.Set on the given
// object. The property name must be given in interface.member notation.
// Panics if v is not a valid Variant type.
func (o *Object) SetProperty(p string, v interface{}) error {
// v might already be a variant...
variant, ok := v.(Variant)
if !ok {
// Otherwise, make it into one.
variant = MakeVariant(v)
}
idx := strings.LastIndex(p, ".")
if idx == -1 || idx+1 == len(p) {
return errors.New("dbus: invalid property " + p)
@@ -160,7 +167,7 @@ func (o *Object) SetProperty(p string, v interface{}) error {
iface := p[:idx]
prop := p[idx+1:]
return o.Call("org.freedesktop.DBus.Properties.Set", 0, iface, prop, v).Err
return o.Call("org.freedesktop.DBus.Properties.Set", 0, iface, prop, variant).Err
}
// Destination returns the destination that calls on (o *Object) are sent to.