Romain Loutrel
79ffbda903
change pairing error values to intenums
...
* refactoring(logitech_receiver/notifications): change to enums PairingError and BoltPairingError
* refactoring(logitech_receiver/notifications): change to enums PairingError and BoltPairingError (Fix pre-commit checks)
* refactor(logitech_receiver/base.py): create unit tests for ping function before replacing ERRORNamedInts by IntEnum
* refactor(logitech_receiver/base.py): create unit tests for request function before replacing ERROR NamedInts by IntEnum
* refactor(logitech_receiver/base.py): create unit tests for ping function before replacing ERRORNamedInts by IntEnum (add exclusion for macOS)
* refactor(logitech_receiver/base.py): create unit tests for ping function before replacing ERRORNamedInts by IntEnum (fix for python < 3.10)
2024-10-23 16:22:22 -04:00
Peter F. Patel-Schneider
2185a8390c
ui: fix initialization bug for PackedRangeControl
2024-10-22 14:31:13 -04:00
rloutrel
0d12c6f229
notifications: Introduce unit tests
2024-10-20 12:57:00 -04:00
MattHag
0cd9c0c9b5
Refactor: Introduce Feature enum
...
Convert Feature NamedInts to SupportedFeature integer enum.
Related #2273
2024-10-14 07:28:09 -04:00
MattHag
06fd32b501
Test and refactor process_notification
...
Related #2273
2024-10-14 07:28:09 -04:00
MattHag
badb76953d
Test key_is_down
...
Related #2273
2024-10-14 07:28:09 -04:00
Peter F. Patel-Schneider
a36973916c
settings: check all bits for extended report rate
2024-10-13 20:46:21 -04:00
rloutrel
15659a1ee4
Fix copy-paste error while refactoring notifications.py
2024-10-11 13:23:55 -04:00
MattHag
194c385824
RuleComponentUI: Type hints methods
2024-10-11 07:42:38 -04:00
MattHag
d1f9b9ca3d
diversion_rules: Add type hints
2024-10-11 07:42:38 -04:00
MattHag
97d1e90ceb
Fix signature of show
...
Fix diverged signature of RuleComponentUI subclasses.
2024-10-11 07:42:38 -04:00
MattHag
9f57955142
Action menu: Move context menu into own class
...
Reduce complexity of diversion dialog.
2024-10-11 07:42:38 -04:00
MattHag
0dec545bfd
Fix rule saving command
2024-10-11 07:42:38 -04:00
MattHag
3277015ab6
diversion: Add type hints
2024-10-11 07:42:38 -04:00
MattHag
bb559c0d7c
base: Remove hard dependency on gi
...
Import gi solely for type checking.
2024-10-11 07:42:38 -04:00
MattHag
1f85ec01e7
base: Add more unit tests
...
Make internal functions private.
2024-10-11 07:42:38 -04:00
MattHag
58ddb0d6cd
Introduce HIDAPI protocol
...
Improve type hints and names.
2024-10-11 07:42:38 -04:00
MattHag
46366b2430
Fix warnings from automatic code inspections
...
Warnings found by automatic code inspection and partially tackled
- Drop distuitls inf favour of setuptools
- Replace deprecated pyudev.Device.from_device_number
- Remove unnecessary brackets
- Avoid access to private variables etc.
- Shadows built-in name
- Line length >120 characters
- Not a module level variable
- Simplify clause
and more
2024-10-11 07:42:38 -04:00
MattHag
0f4d1aebcd
ui/common: Introduce tests
2024-10-11 07:42:38 -04:00
MattHag
89233957dc
settings: Add tests
2024-10-11 07:42:38 -04:00
MattHag
c9e781e752
settings_template: Introduce State enum
2024-10-11 07:42:38 -04:00
MattHag
54aace050c
Replace action strings with constants
...
Avoids spelling mistakes and helps readability.
2024-10-11 07:42:38 -04:00
MattHag
cba3533869
Remove factory wrapper classes
...
A module level function is sufficient, no wrapper needed.
2024-10-11 07:42:38 -04:00
MattHag
ef6b7dec2c
receiver: Remove hard dependency on base
...
With this test all receiver tests are macOS compatible again. The low
level interface supports passing a fake API for unit tests.
2024-10-11 07:42:38 -04:00
MattHag
4e50e605a6
device: Remove hard dependency on base
2024-10-11 07:42:38 -04:00
MattHag
614a5dc633
Add type hints and clean up
2024-10-11 07:42:38 -04:00
MattHag
1729189981
base: Add find_paired_node functions
...
Avoid direct access to hidapi and use the base module as low-level API
instead. This change replaces the remaining calls to find_paired_node
and find_paired_node_wpid by exposing them via base module.
2024-10-11 07:42:38 -04:00
MattHag
90c41dbe32
base: Add find_paired_node functions
...
Avoid the need for hidapi imports and add them to the base API module.
2024-10-11 07:42:38 -04:00
MattHag
a7ad625023
Fix about dialog
2024-10-11 07:42:38 -04:00
MattHag
8d0672ac3c
base_usb: Add external interface
...
Clean up, type hint and tests base_usb and related modules.
2024-10-11 07:42:38 -04:00
MattHag
a75c4b9679
ui/about: Use Model-View-Presenter pattern for testability
...
Split model and view, and enable view mocks for unit tests without GDK.
2024-10-11 07:42:38 -04:00
MattHag
46fafa0e68
hidapi: Explicitly load hidapi/udev implementation
...
Linux uses udev, other platforms use the cross-platform hidapi
implementation. Remove implicit loading of hidapi in hidapi/__init__.py.
2024-10-11 07:42:38 -04:00
MattHag
99fc9c6fcb
receiver: Remove hard dependency on hidapi
2024-10-11 07:42:38 -04:00
MattHag
615499dce2
device: Remove hard dependency on hidapi
2024-10-11 07:42:38 -04:00
MattHag
b681aafaff
keysymdef: Rename key symbols
...
Name the key symbol mapping different than the module itself.
2024-10-11 07:42:38 -04:00
Peter F. Patel-Schneider
4aada31b21
ui: augment pairing message for devices with multiple channels
2024-10-08 15:15:35 -04:00
MattHag
128ec43d70
solaar: Add type hints
2024-10-08 14:35:16 -04:00
MattHag
0481950324
base: Add type hints
2024-10-08 14:35:16 -04:00
MattHag
aa354dc4c4
Replace global sw_id with function call
...
Add test for it.
2024-10-08 14:35:16 -04:00
MattHag
2442299539
base: Simplify receiver info retrieval
...
- Remove comments with unused receivers
- Simplify receiver hardcoded info
2024-10-08 14:35:16 -04:00
MattHag
2aa462532a
settings_template: Prepare removal of desktop_notifications dependency
...
Related #2273
2024-10-08 14:35:16 -04:00
MattHag
d5af19be8a
Make ui/desktop_notifications testable
...
Introduce unit tests.
Related #2273
2024-10-08 14:35:16 -04:00
MattHag
e8ef262433
Rename ui/notify module to desktop notifications
...
Related #2273
2024-10-08 14:35:16 -04:00
MattHag
912afff173
Make lr/desktop_notifications testable
...
Introduce unit tests.
Related #2273
2024-10-08 14:35:16 -04:00
MattHag
0f8ab61ddf
Rename lr/notify module to desktop_notifications
...
Related #2273
2024-10-08 14:35:16 -04:00
MattHag
3c1aa35067
hidapi: Completely remove dependency on gi
...
Related #2480
2024-10-08 14:35:16 -04:00
MattHag
8fb087be14
logitech_receiver: Remove GDK dependency
2024-09-15 09:18:51 -04:00
MattHag
ea0eb66f39
Refactor: Remove all GDK dependencies from hidapi package
...
The hidapi hardware layer must not know or depend on any UI libraries.
Removes all GDK dependencies from the hidapi packages, which makes
testing of these modules easier and removes unwanted cross-dependencies.
Related #2480
2024-09-15 09:18:51 -04:00
MattHag
70def31942
Refactor: Distinguish module from package
...
Adapt module names to easily distinguish them.
Related #2480
2024-09-15 09:18:51 -04:00
Peter F. Patel-Schneider
fdd2c79950
settings: allow unkonwn keys in Key rule conditions
2024-08-28 10:40:23 -04:00