Commit Graph
47 Commits
Author SHA1 Message Date
Guido Günther 7d89180dda libfeedback: Allow to set sound-file hint
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-01-26 16:12:13 +01:00
Guido GüntherandTomi Lähteenmäki 1f9ac79445 tests: Use decimal values
We don't rely on that anywhere anyway.

Co-authored-by: Tomi Lähteenmäki <lihis@lihis.net>
Closes: https://source.puri.sm/Librem5/feedbackd/-/issues/79
2024-07-24 17:35:42 +00:00
Guido Günther 3c02259156 event: Allow to end events by level
The level here is an abstract value but in fact matches the profile
level. Well make this a property when fixing #35.
2024-06-21 19:57:29 +00:00
Guido Günther e7c370a589 tests/fbd-event: Check if objects are finalized
This gives us more info than just using automatic cleanup
2024-06-21 19:57:29 +00:00
Guido Günther 924320bbf9 fbd-event: Fix some indent
Gbp-Dch: Ignore
2024-06-21 19:57:29 +00:00
Guido Günther 8f67dbd120 feedback-led: Allow to prefer flash LEDs over notification LEDs 2024-06-15 11:14:40 +02:00
Guido Günther e47ce8e09e led: Add flash LED type
Camera flashes are also exported via the LED subsystem. We use a
separate LED type so they're not picked by default.

We don't use them as fallbacks either.
2024-06-15 11:14:40 +02:00
Guido Günther a4c35a8e61 led: Parse color values and pass them down the chain
We parse RGB color values as HEX ('#RRGGBB') and use those when a RGB
LED is available. Single color LEDs won't see a change.
2024-06-13 15:19:03 +02:00
Dylan Van Assche 2b53725fcb fbd-dev-led-qcom-multicolor: Support QCOM LPG LED multicolor
QCOM LPG LEDs can also operate in a multicolor fashion.
Re-use the probing sequence of multicolor LEDs and the hw_pattern
configuration of single color QCOM LPG LEDs.
2024-06-09 11:21:20 +02:00
Dylan Van Assche 10e6d3cba8 fbd-dev-led-qcom: Support QCOM LPG LED single color
QCOM LPG LEDs expose a hw_pattern sysfs entry which accepts a limited
set of patterns but allows to use dedicated hardware for blinking the
LED. This way, battery life can be improved and the LED still blinks,
even if the device is suspended.
2024-06-09 11:21:20 +02:00
Dylan Van Assche 22e4c33606 fbd-dev-led-multicolor: Support red, green, blue and white LED colors
Provide our own supports_color method to specify which colors are
actually implemented by the driver. RGB LEDs could provide different
colors as well such as orange, purple, etc. but those are not supported
yet.
2024-06-09 11:21:20 +02:00
Dylan Van Assche e43126b007 fbd-dev-led: Rework color API
Drop has_color API since supported colors are set during probing
and can be handled completely separately from the classes for
each type of hardware.

Rename set_color to set_supported_color because the usage
of this API is to check if the color is supported, but not
setting it. Setting the color is also separated from
start_periodic API to re-use multicolor across multiple LED types
with a set_color API. Multicolor LEDs are actually the same as
regular LEDs but they require a few additional sysfs entries to
actually set the color. Single color LEDs only have a single color
so the set_color method just returns TRUE for these LEDs.

Supported colors are advertised through the supports_color API now.
This way, each LED driver define which colors are supported
through supports_color API. RGB multicolor LEDs will report only fixed colors
like red, blue, green and white until the kernel can expose if a diffusor
is present to mix these colors.
2024-06-09 11:21:19 +02:00
Guido Günther d5b0f30205 tests: Add umockdev based tests for leds
This ensures we can probe the different led types correctly

The umockdev data was recoreded on an Librem 5 and Librem 14
2024-05-17 06:24:50 +00:00
Guido Günther 14ffd9722d libfeedback: Allow to set important hint 2024-04-20 13:21:56 +00:00
Guido Günther 2de190fb09 lfb-event: Add getter and setter for app-id
For applications this is figured out automatically but notification
daemons and portal implementations might want to override it to have the
per-app feedback profile picked up automatically.
2023-04-17 13:32:21 +02:00
Guido Günther a58b47e1eb tests: Get properties all at once 2023-04-17 12:21:06 +02:00
Guido Günther 1a5cd090de lfb-event: Avoid allocation when getting profile
We can return the const *. This makes it consistent with other getters.

This is an API change we didn't find any users and the API is declared
unstable.
2023-04-17 12:21:06 +02:00
Guido Günther f9c65381db tests/profile: Don't leak json node 2023-03-13 15:26:20 +01:00
Guido Günther 1933a23172 tests: Don't leak profiles and test that
We finalize the theme first so the last reference is dropped when
finalizing the profiles.
2023-03-13 15:26:07 +01:00
Guido Günther 460985cfa0 tests: Don't leak json string 2023-03-13 15:26:04 +01:00
Chris Vogel d4197ed7a4 run: Don't hardcode feedbackd
This allows arbitrary executables from the source tree with
a well defined environment.
2022-12-15 10:57:09 +01:00
Guido Günther 9e13793bbe tests: Help old glib on PureOS along 2022-12-11 17:34:38 +01:00
Guido Günther a75cdbbc59 theme-expander: Allow to set the theme to expand 2022-12-11 17:34:38 +01:00
Guido Günther 242519498a Recursively load themes
Themes (other than the default theme) can specify a `parent-name` in the
json file. This theme will be used as a base for the theme. Events and
profiles of the children override those in the parents.

For this we move the lookup code into it's separate class and also add
tests.

Closes: #38
2022-12-11 17:34:38 +01:00
Guido Günther ada82a0ed1 feedback-theme: Allow to get and set parent theme name
If set the parent theme's feedbackd and profiles should be merged into
this theme.
2022-12-08 10:05:47 +01:00
Guido Günther e10b2cc150 feedback-theme: Allow to update theme
New profiles are added, existing profiles updated. This will
allow to merge themes.
2022-12-08 10:05:47 +01:00
Guido Günther d7f97dca51 feedback-profile: Allow to update profiles
Allow to add feedbacks from a profile to another one
2022-12-08 10:05:47 +01:00
Guido Günther 96b6af3766 tests: Test feedback theme name 2022-12-08 10:05:47 +01:00
Guido Günther 7b7422f98e build: Bump required meson version 2022-12-06 11:49:13 +01:00
Evangelos Ribeiro Tzaras 72c7d3ba25 tests/integration: Test that "feedback-ended" is propagated through LfbEvent
When no feedbacks are available (either because the requested event does
not exist in the theme or because the system does not have required
capabilities, e.g. no vibration motor or LED) feedbackd will emit a
"feedback-ended" signal (with reason LFB_EVENT_STATE_REASON_NOT_FOUND)
on DBus _before_ completing the event triggering DBus call.

Since the DBus call was not completed yet, LfbEvent will not have
learned it's ID yet and therefore not emit it's own "feedback-ended"
GObject signal.

In this case the test will timeout since the main loop is never quit.
2022-11-09 11:54:44 +01:00
Evangelos Ribeiro Tzaras efca781f7f tests/integration: Fix whitespace
Remove all tabs in favour of spaces and align function arguments.
2022-11-09 11:54:06 +01:00
Evangelos Ribeiro Tzaras 15d33f4f85 tests/integration: Indicate that callback quits main loop
on_event_triggered() is renamed to on_event_triggered_quit()
as we will shortly introduce a variant that does not quit.
2022-11-09 11:50:10 +01:00
Guido Günther 437d8290bf tests/integration: Check the state of the ended event 2022-10-12 10:19:03 +02:00
Guido Günther e782032efd tests: Drop unused variable 2022-10-12 10:19:03 +02:00
Evangelos Ribeiro Tzaras 21399aec6e test-lfb-integration: Test event state in async callback 2022-10-11 12:32:26 +02:00
Guido Günther a7a123a0b7 tests: Remove unused variables 2022-02-04 19:03:00 +01:00
Guido Günther 66bcb31a0e fbd-event: Add sender property
This allows us to store the DBus sender
2021-04-22 14:43:30 +02:00
Guido Günther 0936b5fb09 tests: Run event tests too 2021-04-22 14:43:30 +02:00
Guido Günther 53a02c719c test-lfb-integration: Test invocation error 2021-02-05 16:56:24 +01:00
Guido Günther d6e3df7ebc tests: Run lfb_event_{get,set}_timeout 2021-02-05 16:56:24 +01:00
Guido Günther fb076254c9 tests: Test event not found case too 2020-07-24 11:58:26 +02:00
Guido Günther cfab476edb tests: Don't check end reason in feedback handler
This allows to reuse the feedback handler and we check the
reason in the actual test function anyway.
2020-07-24 11:58:26 +02:00
Guido Günther 3a378552af tests: Use async feedback as the test name implies 2020-07-13 16:06:44 +02:00
Guido Günther 134d60c73b tests: Don't quiet mainloop on event end
This is needed to properly test aync where we have the
finished async event handler and the signal.
2020-07-13 10:16:20 +02:00
Guido Günther 50aeb79ec9 LfbEvent: Add feedback-profile property
This allows to specify the feedback profile to use for
this particular event.
2020-07-10 09:20:04 +00:00
Rasmus Thomsen 851b46f4a4 build: add proper dependencies on gdbus-codgen-generated headers
Without this it was possible that ninja built a target that needs
the generated header before the header was generated

fixes #14
2020-04-24 15:25:11 +02:00
Guido Günther 3663b7d149 Initial commit
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2020-02-14 17:40:34 +01:00