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
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
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
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
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
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
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
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
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
Peter F. Patel-Schneider
4578f5f6f1
device: cycle sw_id to better guard against duplication of messages
2024-08-23 19:41:10 -04:00
Peter F. Patel-Schneider
c07c30baef
device: handle error return on root feature
2024-08-23 19:41:10 -04:00
Peter F. Patel-Schneider
d9d67ed738
device: handle unknown device kinds
2024-07-02 10:59:16 -04:00
Peter F. Patel-Schneider
3aa064b40f
settings: finish change to new constants
2024-06-13 10:01:50 -04:00
MattHag
86b55b9c25
Introduce Enum BusID
...
Distinguishes Bluetooth and USB devices.
2024-06-03 08:37:02 -04:00
MattHag
7f5e156fa1
Introduce constant for Logitech vendor ID
...
The Vendor ID for Logitech is 0x46D = 1133.
2024-06-03 08:37:02 -04:00
MattHag
d67466298b
Introduce Enum for notification types
2024-06-03 08:37:02 -04:00
MattHag
9726b93a78
Improve base module
...
Use clearer names and type hints.
2024-06-03 08:37:02 -04:00
MattHag
e316ed1bc2
Remove unnecessary receiver info 'hid_driver'
...
The same constant is used everywhere.
2024-06-03 08:37:02 -04:00
MattHag
a5ded24057
Convert HIDPPNotification to dataclass
...
Replaces the very last namedtuple.
2024-06-03 08:37:02 -04:00
Peter F. Patel-Schneider
2113e63a75
device: be defensive when converting battery status to string
2024-06-03 08:33:11 -04:00
MattHag
be83dac209
hid: Convert definition of HID registers to enum
...
* Refactor HID Register definitions
Use enums for distinct type hints, easy discovery of registers.
Make constants uppercase and benefit from enum auto-completion.
Related #2273
* Improve type hints: Registers
2024-06-02 10:34:00 -04:00
MattHag
c23ebcd267
Use double quotes for module level docstrings
...
Make module level docstrings distinguishable from license text.
Related #2273
2024-06-02 09:54:21 -04:00
MattHag
5a63e44d58
Remove empty comment lines
...
Remove hashtags solely used for structuring.
Related #2273
2024-06-02 09:54:21 -04:00
MattHag
c29231bc6b
refactor: Creation of devices ( #2493 )
...
* Refine interfaces for testability
* Reenable fixed device tests
2024-05-27 11:58:16 -04:00
MattHag
815dce07be
Unify imports in logitech package
...
Related #2273
2024-05-23 16:42:18 -04:00
Peter F. Patel-Schneider
90b0db6c3b
device: don't ping device when getting name or codename
2024-05-22 21:22:08 -04:00
Matthias Hagmann
c9dc232951
Refactor: Use dataclasses and enums
...
Replace unnecessary NamedInts in favour of default data types.
Simplify interfaces by reducing possible input from strings to members
of an enum.
2024-05-22 21:14:41 -04:00
Matthias Hagmann
469c04faaf
Introduce Device protocol and type hints
2024-05-22 21:14:41 -04:00
Matthias Hagmann
193dbfda21
hidpp10: Move independent functions to module level
2024-05-22 21:14:41 -04:00
MattHag
500b9998c5
Fix macOS compatibility and reenable CI tests
...
* Fix CI for macOS
* Fix error message for missing hidapi
* Skip some device and receiver tests on macOS
Tests fail on macOS, enable them when unit tests are
refined to only test the module without dependencies.
* Safe guard dbus import
2024-05-22 18:45:40 -04:00
Peter F. Patel-Schneider
1dfc4bdb1c
settings: add choices universe for backlight setting
2024-05-08 08:05:00 -04:00
MattHag
1d5b61fbf2
diversion: Simplify and type hint
...
- Make static method an easy testable function.
- Fix variable name clashes
2024-05-05 10:43:39 -04:00
Peter F. Patel-Schneider
3ffa4e30f1
settings: get and use current host number for K375sFnSwap because of bug in firmware of MX Keys S
2024-05-04 04:46:27 -04:00
Peter F. Patel-Schneider
da1cb53c1b
settings: optimize write for per-key lighting
2024-05-03 11:54:24 -04:00
Peter F. Patel-Schneider
e5967edc66
settings: add and initialize per-key lighting to a special no-change value
2024-05-03 11:54:24 -04:00
MattHag
959dd2a35b
Refactor rule loading for testability ( #2456 )
...
rules: Introduce tests for YAML rule loading functionality.
2024-04-27 17:56:27 -04:00
Peter F. Patel-Schneider
932bc5cb0e
device: check for existences of keys file before opening
2024-04-21 17:37:10 -04:00
MistificaT0r
4225fce8d7
po: update Russion translation and have all strings translated
...
* update Russian translation
* Fixed translation display in GUI
* fix checks / Fixed translation display in GUI
2024-04-21 11:36:39 -04:00
Peter F. Patel-Schneider
cf038fd982
settings: improve label and description for LED zone settings
2024-04-19 16:05:29 -04:00
Peter F. Patel-Schneider
7bef5c046c
settings: add message about Onboard Profiles to LED Zone settings
2024-04-19 16:05:29 -04:00
Peter F. Patel-Schneider
c4e2a5683a
device: initialize device registers to empty list
2024-04-19 16:05:29 -04:00
Peter F. Patel-Schneider
e667d41c7b
solaar: use bluez dbus signals to disconnect and connect bluetooth devices
2024-04-18 20:32:40 -04:00
Peter F. Patel-Schneider
d7ce636917
device: handle a different signal for onboard profiles directory in ROM
2024-04-15 14:40:50 -04:00
Peter F. Patel-Schneider
86bab897d1
receiver: introduce small delay in getting pairing information to let receiver settle after pairing
2024-04-15 14:40:50 -04:00
Peter F. Patel-Schneider
b616419f72
device: fix bug found in testing
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
269e970aa6
device: fix small bugs uncovered by testing
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
d6499808f9
device: fix bugs in onboard profiles found during testing
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
3855409605
device: fix bugs in hidpp20 found during testing
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
d12575b47d
tests: test GESTURES settings
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
e64eec18e9
tests: extend testing of hidpp20
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
b43cdace79
tests: expand tests for settings_templates
2024-04-09 10:31:06 -04:00
Peter F. Patel-Schneider
8de3a1d2e2
device: better support for extended ajustable dpi
2024-04-09 10:31:06 -04:00
Peter F. Patel-Schneider
ab94f1be07
device: limited support for extended adjustable dpi
2024-04-09 10:31:06 -04:00
Peter F. Patel-Schneider
c70e8b54bf
tests: remove unused code
2024-03-27 18:02:55 -04:00
Peter F. Patel-Schneider
afe04b9804
settings: remove unused code and fix but in EQUALIZER setting
2024-03-27 11:15:15 -04:00
Peter F. Patel-Schneider
f38fbcf949
settings: provide symbolic names for per-key lighting keys
2024-03-27 11:15:15 -04:00
Peter F. Patel-Schneider
4d0f93b35c
tests: improve infrastructure for testing setting_templates
2024-03-27 11:15:15 -04:00
Peter F. Patel-Schneider
1ed5f765e3
settings: implement and test per-key lighting
2024-03-27 11:15:15 -04:00
Peter F. Patel-Schneider
bd437b548b
ui: refactor pair_window
2024-03-25 09:13:22 -04:00
Peter F. Patel-Schneider
8ee291c144
settings: add in bit telling RGB effects changes to change ROM
2024-03-24 15:44:15 -04:00
Peter F. Patel-Schneider
1a874c39d7
settings: permit continuing when a read during pushing fails
2024-03-24 15:44:15 -04:00
Peter F. Patel-Schneider
e202e904b4
settings: add settings for RGB EFFECTS feature
2024-03-24 15:44:15 -04:00
Peter F. Patel-Schneider
c8288a6b69
settings: fix bug in LEDZoneSetting when effect is not implemented
2024-03-24 15:44:15 -04:00
Peter F. Patel-Schneider
c81809bd39
device: add RGB EFFECTS feature version of LED COLOR EFFECTS data
2024-03-24 15:44:15 -04:00
Peter F. Patel-Schneider
490493d7a3
device: handle BRIGHTNESS CONTROL notifications
2024-03-24 15:44:15 -04:00
Peter F. Patel-Schneider
3876f07d57
settings: implement and test BRIGHTNESS_CONTROL
2024-03-24 15:44:15 -04:00
Peter F. Patel-Schneider
4fd75a64ff
settings: fix small bugs found from testing
2024-03-24 07:02:39 -04:00
Matthias Hagmann
6f613b17c7
refactor: Manually improve f-string formatting
2024-03-24 07:01:56 -04:00
Matthias Hagmann
4e6361429e
refactor: Use f-strings for more exceptions and log message
...
Semi manually convert remaining strings with no translation to f-string.
2024-03-24 07:01:56 -04:00
Peter F. Patel-Schneider
d1d3d71091
settings: patch to make python 3.7 happy
2024-03-23 10:11:30 -04:00
Peter F. Patel-Schneider
17bbc9c4ea
settings: simple change to improve testability
2024-03-23 10:11:30 -04:00
Peter F. Patel-Schneider
47ba1402ed
device: use feature_request from the device everywhere in hidpp20
2024-03-23 10:11:30 -04:00
Peter F. Patel-Schneider
7d6428a03b
settings: fix bug in backlight 2 durations
2024-03-23 10:11:30 -04:00
Peter F. Patel-Schneider
ebc76bca24
tests: add tests for logitech_receiver device
2024-03-23 08:26:12 -04:00
Peter F. Patel-Schneider
480badbe8c
device: align init methods for all receiver classes
2024-03-16 16:24:33 -04:00
Peter F. Patel-Schneider
6164317a64
tests: improve hidpp20 coverage
2024-03-16 16:20:39 -04:00
Peter F. Patel-Schneider
dcd72b0178
device: fix bug in hidpp10 get_device_features
2024-03-16 16:20:39 -04:00