node-dbus-next
node-dbus-next copied to clipboard
Dynamically disable interface members
Some properties, methods, or signals might be optional. Mpris for instance has optional properties. Optional members should be omitted from introspection xml and ignored when they are gotten/set/called.
Maybe like this:
iface.disableProperty('OptionalProp');
Or maybe like this for more extensibility:
iface.getPropertyInfo('OptionalProp').disabled = true;
Maybe a few static methods on the Interface to do this.
static updatePropertyOptions(iface, name, options);
static updateSignalOptions(iface, name, options);
static updateMethodOptions(iface, name, options);
Eh maybe this isn't a good idea because of how introspection normally works. You can use class expressions to dynamically make your classes to accomplish the use case.