We need to read the directory and the profiles only once.
Nothing tells us how many profiles are supported, so use the specifications
from Logitech website, and add a hwdb entry for those.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The usage help is wrong, it's not how it works.
It'll be too much pain to fix it the other way around, and I prefer
using "ratbag* profile N enable" than "ratbag* profile enable N".
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Now that we've moved all properties to read-write where required, unleash the
exception again - any UnknownProperty error is now a bug.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This also drops the separate x/y properties and instead just returns a tuple
for "Resolution".
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is superfluous, it's trivial enough to get the Resolutions property and then
work with that. We're not talking about a huge amount of data anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is superfluous, it's trivial enough to get the Profiles property and then
work with that. We're not talking about a huge amount of data anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Instead of a GetActiveProfile in the device, make this a property of the
profile. The SetActive method stays around, it's less prone to mis-use than
the property since we cannot allow a caller to go "profile.is_active = False"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Our device list is so small that having separate signals is a bit pointless,
updating the property should be sufficient.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
set_cached_property merely updates the proxy's own copy, it doesn't do
anything to the remote. Manually call the DBus.Properties.Set interface
to do that.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
When running in a container (CircleCI), dbus may not be available. Throw one
of our errors to be consistent with our behavior when the name owner isn't
available.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We are using a custom python script to generate the final ratbagctl
so we can strip out the headers.
Now merging and testing ratbagd.py in piper will be easier than ever.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This reduces the time to run the tests from (now with previous commit) 10s
to a mere 2 seconds.
The --subprocess argument is voluntarily masked from the help message,
because I couldn't figure out how to add it to the unittest parser.
And OTOH, we should not run in subprocess unless debugging...
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Now that we have a method which resets the device, use it so we can
rely on the state of the device.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
When developing with ratbagd, we need to test against master, not
the system-wide installed daemon.
Allow to name space ratbagd with the creation of a new (not installed)
rabtagd.devel daemon, that is tagged with the git sha of the ratbagd
folder.
Handle this namespace in ratbagctl by looking at an environment variable
RATBAGCTL_DEVEL.
Then provide a python script that launches both rabtagd.devel and
ratbagctl with the correct environment variable set so that they can
talk to each other.
Note that we blindly overwrite the dbus .conf file as nobody else than
developers should have one.
Note: the tagging of ratbagd.devel (like the meson bit) won't run unless
a rebuild is triggered. So we don't necessarily always get the right git
tag. However, touching ratbagctl.in triggers a rebuild, so we should be
OK-ish.
Fixes#206
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
File "./build/ratbagctl", line 713, in main
cmd.func(r, cmd)
UnboundLocalError: local variable 'r' referenced before assignment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This merges ratbagd into libratbag, keeping the histories of both projects intact (hence the rather large merge). The meson.build files are merged and a few things are shuffled around to look like one normal project directory. The build artifacts are still the same, i.e. we still build libratbag and ratbagd.
It's a mix of tabs and spaces. Let's use spaces to keep the formatting.
And move "switch-etekcity" back to the end, it's a special case.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Or we will take the defaults that are not intuitive (like white color
when setting to on).
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Allows to follow the usage message: we do not need to provide the
currently active profile.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Rename "breath" in the help text and reporting for the led mode to
"breathing". The actual command to set the mode was already called
that way.
Signed-off-by: Christian Kellner <christian@kellner.me>