Replies: 1 comment 10 replies
-
|
Hello @colazzo Have you tried using the inheritance and See this unit test: python-sdbus/test/test_sd_bus_async.py Lines 315 to 327 in 9040f15 I have not tested it but it should be possible to use the overridden property and the |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Is there a way to set a read-only property from the server class that implements the interface without changing the generated interface file?
Such property is typically set at runtime by the server that implements the interface, and it is not enough to use a member variable directly because in most cases you want the 'property changed' signal being fired when the property is set internally by the server.
I guess the
@sdbus.setter_privatecan only be defined in the interface class in order to be able to useset_async()on the property?But then you would need to manually change the interface file after having generated from xml.
Is there a way to set property (with property changed signal) without changing the generated file?
Ideally you can define everything in the xml, run the generator and implement the interface for your dbus service.
An idea would be to generate the
@sdbus.setter_privatein case the property is defined withaccess="read",and provide possibility to override the private setter.
Same for
access="readwrite"properties where you could have the@sdbus.setteralready generated.Beta Was this translation helpful? Give feedback.
All reactions