Commit Graph

109 Commits

Author SHA1 Message Date
Peter F. Patel-Schneider 694513832d
device: report symbolic names for pairing errors (#2886)
* device: report symbolic names for pairing errors

* testing: fix testing of notifications
2025-05-31 08:12:42 -04:00
Peter F. Patel-Schneider abea1c4341 device: add present flag, unset when internal error occurs, set when notification appears 2025-04-22 08:45:55 -04:00
Peter F. Patel-Schneider 217b9360e6 device: pause setting up features when error occurs; use ADC message to signal connection and disconnection 2025-04-22 08:45:55 -04:00
MattHag d42524dec9 notification: Remove alias for SupportedFeature
Related #2273
2025-01-02 08:05:02 -05:00
MattHag 8894463f64 notification: Refactor process_device_notification
Simplify code and unify interfaces and type hints.

Related #2273
2025-01-02 08:05:02 -05:00
MattHag 15aaba2802 notification: Refactor process_receiver_notification
Remove repeated code pattern with generalized implementation. Aim
towards easy extension and code readability.

Related #2273
2025-01-02 08:05:02 -05:00
MattHag fa3a9bc5b3 notification: Refactor receiver event handling
Split processing of receiver notification into smaller functions.
Extract handler functions for every receiver notification for simple
maintenence and testability.

Related #2273
2025-01-02 08:05:02 -05:00
MattHag 810cda917a Refactor notifications
Add type hints and reasonable variable names.

Related #2711
2025-01-01 13:48:14 -05:00
MattHag 64ac437b7f Rename variable to full name notification
Related #2711
2025-01-01 13:48:14 -05:00
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
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
rloutrel 15659a1ee4 Fix copy-paste error while refactoring notifications.py 2024-10-11 13:23:55 -04:00
MattHag d67466298b Introduce Enum for notification types 2024-06-03 08:37:02 -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 815dce07be Unify imports in logitech package
Related #2273
2024-05-23 16:42:18 -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
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 490493d7a3 device: handle BRIGHTNESS CONTROL notifications 2024-03-24 15:44:15 -04:00
Matthias Hagmann 5b09ace1f5 ruff: Apply single line import format
# Usage
pre-commit run --all-files

Related #2295
2024-03-13 15:41:21 -04:00
Peter F. Patel-Schneider b957217ea8 receiver: delay device sending first messages 2024-03-13 08:34:28 -04:00
Peter F. Patel-Schneider 9c5ba6445e device: remove status from Device and Receiver 2024-03-11 08:23:27 -04:00
Peter F. Patel-Schneider a1418cd834 device: move changed method from status to Device and Receiver 2024-03-11 08:23:27 -04:00
Peter F. Patel-Schneider 1fe2eab1a4 device: move link_encrypted from status to Device 2024-03-11 08:23:27 -04:00
Peter F. Patel-Schneider 15d425c365 device: move battery information from status to Device 2024-03-11 08:23:27 -04:00
Peter F. Patel-Schneider 0805ecb511 device: move status string function to Device and Receiver 2024-03-11 08:23:27 -04:00
Peter F. Patel-Schneider 87285faf7f receiver: move pairing status to new dataclass attached to receiver 2024-03-11 08:23:27 -04:00
Peter F. Patel-Schneider 135c8b8cb9 device: use status attribute for error 2024-03-09 10:36:40 -05:00
Peter F. Patel-Schneider 6b3f09aa5d device: use status attribute for link_encrypted 2024-03-09 10:36:40 -05:00
Peter F. Patel-Schneider 64d8cad81a device: change status battery fields to Battery objects 2024-03-09 10:36:40 -05:00
Matthias Hagmann 9c76a6c5ba refactor: Introduce Hidpp20 class
Related #1097
2024-03-02 10:56:41 -05:00
Matthias Hagmann 85149a809e refactor: Introduce Hidpp10 class
Related #1097
2024-03-02 10:56:41 -05:00
Matthias Hagmann c3b01bffae fix: Replace invalid hidpp10 usage
Related #1097
2024-02-28 17:41:46 -05:00
Peter F. Patel-Schneider b7afc410ba device: clean up listener and notifications code 2024-02-23 11:37:23 -05:00
Peter F. Patel-Schneider 646ef2f596 device: move battery constants common to HID++ 1.0 and 2.0 to common 2024-02-22 09:57:02 -05:00
Matthias Hagmann 7774569971 Apply ruff format
Run ruff auto formatting using:
ruff format .

Related #2295
2024-02-20 15:41:10 -05:00
Peter F. Patel-Schneider ed248c62b9 device: add callback to call when changing a setting 2024-02-20 06:19:23 -05:00
Matthias Hagmann 5f487dd3b2 logitech_receiver: Move hidpp20 constants into new module
Related #1097
2024-02-20 05:58:33 -05:00
Peter F. Patel-Schneider 12de240949 device: improve imports in logitech_receiver
device: move imports of ui modules to beginning of files

logitech_receiver: remove imports from __init__.py
2024-02-18 06:21:35 -05:00
Peter F. Patel-Schneider 31d795fcb8 device: improve imports in logitech_receiver
device: move some imports to top of modules

device: break up imports loop with device descriptors

device: break up imports loop by moving a function from notifications.py to setting_templates.py

device: break import loop between device.py and diversion.py by using device to access method
2024-02-18 06:21:35 -05:00
Peter F. Patel-Schneider 468fad1358 ui: refactor code to record change to setting 2024-02-10 14:45:00 -05:00
MattHag 87658fb189
logging: Simplify logger instantiation
* logging: Simplify logger instantiation

Relates #2254

* logging: Remove aliases

Relates #2254

* logging: Replace deprecated warn with warning

Related #2254

* logging: Fix mistake

Related #2257
2024-02-10 13:55:27 -05:00
Peter F. Patel-Schneider 0548bde44f ui: handle onboard profiles notifications 2024-02-07 18:48:22 -05:00
Peter F. Patel-Schneider 9c4bbec5e2 ui: handle backlight notification 2024-02-06 12:49:08 -05:00
Peter F. Patel-Schneider 773dac56b6 solaar: improve handling of wheel notifications 2022-12-09 06:59:37 -05:00
Peter F. Patel-Schneider 99f9c8762e settings: only record changes of scroll wheel ratchet 2022-12-09 06:59:37 -05:00
Peter F. Patel-Schneider 5bf999b841 device: switch scroll ratcheting setting in response to scroll ratchet key notification 2022-10-26 20:56:09 -04:00
Peter F. Patel-Schneider 6b1e8f8a99 device: fix processing of HID++ 1.0 battery reports 2022-10-13 07:57:57 -04:00