Commit Graph

2810 Commits

Author SHA1 Message Date
MattHag 0cd9c0c9b5 Refactor: Introduce Feature enum
Convert Feature NamedInts to SupportedFeature integer enum.

Related #2273
2024-10-14 07:28:09 -04:00
MattHag 11e7cbde69 Test Feature class
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 691e5878f9 Remove obsolete pytest fixture 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 37e2ac80ba base: Add test for filter_products_of_interest 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 9907cb2875 Test coverage: Fix keysyms to be visible (#9)
Fix typo in package name.
2024-10-11 07:42:38 -04:00
MattHag 65d3b406c0 keysyms: Introduce tests for this package 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
MattHag 32fef49ff8 Upload test coverage reports solely after merging
Related #1097
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 c76b0ef36b Add code coverage badge
Related #1097
2024-10-08 14:35:16 -04:00
MattHag b1b9f01083 Setup reports and upload codecov
Create coverage.xml, upload it to GitHub CI and visualize with codecov.

Setup instruction:
- Install codecov for project
  https://github.com/settings/installations/55029514
- Add CODECOV_TOKEN in the GitHub CI project secrets

Related #1097
2024-10-08 14:35:16 -04:00