Add project infrastructure and core application files

Add .gitignore, GitLab CI pipeline with test/lint/build/release stages, project documentation (README, LICENSE, CHANGELOG, CONTRIBUTING, SECURITY), PyInstaller packaging configuration with icon and version info, Python project configuration with dependencies, and complete application source including battery provider, device discovery, settings management, UI components, startup control, and comprehensive test suite
This commit is contained in:
2026-06-21 11:07:05 +02:00
parent 7ef92caef8
commit 454cad95c5
33 changed files with 1111 additions and 67 deletions
+19
View File
@@ -0,0 +1,19 @@
from logitech_battery_widget.battery.provider import ChargeStatus
from logitech_battery_widget.battery.windows_hid import WindowsHidBatteryProvider
def test_hidpp_charge_status_mapping():
provider = WindowsHidBatteryProvider()
assert provider._status(0) == ChargeStatus.DISCHARGING
assert provider._status(1) == ChargeStatus.CHARGING
assert provider._status(4) == ChargeStatus.CHARGING
assert provider._status(99) == ChargeStatus.UNKNOWN
def test_device_name_is_clear_and_vendor_prefixed():
provider = WindowsHidBatteryProvider()
assert provider._name({"product_string": "MX Keys"}) == "Logitech MX Keys"
assert provider._name({"product_string": "Logitech G Pro"}) == "Logitech G Pro"
assert provider._name({}) == "Logitech HID Device"