Commit Graph

67 Commits

Author SHA1 Message Date
Daniel Pavel cd437c3809 only set NOTIFICATION_FLAGS for 1.0 devices 2013-07-04 13:22:35 +02:00
Daniel Pavel a03cc9ce64 more chair switching -- moved notifications handling into own .py 2013-07-03 08:21:40 +02:00
Daniel Pavel 9a2a28e0aa replaced hard-coded register numbers with constants
also re-worked the battery reading code a bit
2013-07-02 12:23:12 +02:00
Daniel Pavel eaa38c858c properly format battery status string for 0x07 devices 2013-07-01 11:51:20 +02:00
Daniel Pavel 8d5718178f load the configuration when the device is detected
and apply it every time the device comes online
2013-06-29 20:35:02 +02:00
Daniel Pavel 1d438f098f handle 0x07 battery notifications with indicating charging, but with no battery level 2013-06-29 20:26:29 +02:00
Daniel Pavel 0cf1f1983d handle backlight notifications from register 0x17 2013-06-26 13:38:36 +02:00
Daniel Pavel f64942b51d if the battery level is approximative, show a string instead of percentage 2013-06-24 17:02:00 +02:00
Daniel Pavel 20dfc063ff initial support for performance mx leds
The leds light up when we get updates about the battery level.
Right now they are not (programatically) turned off.
2013-06-23 20:59:16 +02:00
Daniel Pavel 70c341e268 don't use proxies for receiver/device objects
they should be unnecessary now that their status is properly tracked
2013-06-23 18:37:50 +02:00
Daniel Pavel 273284da39 use number instead of serial to pick devices in ui (faster start-up) 2013-06-23 12:09:46 +02:00
Daniel Pavel df8df2bffa don't force a battery read on link active, will happen anyway 2013-06-21 22:24:28 +02:00
Daniel Pavel 5785896007 status: the device may be invalid when processing the unpair notification 2013-06-21 16:39:30 +02:00
Daniel Pavel c1aa341a7a tweaked timing of enabling receiver notifications 2013-06-21 15:20:52 +02:00
Daniel Pavel fd35f23af7 one a separate flag to check if the device is active 2013-06-21 15:17:14 +02:00
Daniel Pavel 4bc525f250 minor clean-ups 2013-06-20 11:02:45 +02:00
Daniel Pavel 11cfc7ea09 enable notification on recevier as soon as possible 2013-06-19 19:46:54 +02:00
Daniel Pavel a806f2672d group all status keys into one object 2013-06-19 19:45:39 +02:00
Daniel Pavel b4bca4670b cache notification flags when possible
avoids unnecessary reads from devices when the status hasn't changed
2013-06-19 17:03:01 +02:00
Daniel Pavel 57c759773a attach configuration to device settings objects 2013-06-17 11:00:53 +02:00
Daniel Pavel 04ea8293a8 persist and restore device settings 2013-06-16 17:41:03 +02:00
Daniel Pavel febf571d84 account for devices going out-of-range while active 2013-06-16 17:10:46 +02:00
Daniel Pavel 8852d50971 mark device status as inactive after idling out 2013-06-12 14:31:46 +02:00
Daniel Pavel 237d0f9d9a keep the battery level if polling the device marks it as offline 2013-06-08 21:05:30 +02:00
Daniel Pavel ed5ce48f65 fixes to polling receiver/device status 2013-06-08 16:16:12 +02:00
Daniel Pavel cbdc0bd99b very low battery level should trigger an attention event 2013-06-03 21:40:15 +02:00
Daniel Pavel c61eb3f039 show charging status in device icon 2013-06-01 22:08:14 +02:00
Peter Wu 6ae11f862c Add more feature names, rename existing ones
Extracted from SetPoint 6.52.74 software using:

    <FeaturesSupported.xml awk -F\" '/<Feature /{sub(/^LD_FID_/, "", $2); printf("\t%s=%s,\n", $2, $4)}' | sort -t= -k2

Existing names are renamed to the newer, verbose names.
2013-05-26 23:47:40 +02:00
Daniel Pavel 131f8f7f45 disable status polling on devices
the regular flow should be reading the battery on all devices now
2013-05-22 20:42:26 +03:00
Daniel Pavel c3b73964d5 improved support for some Nano receivers 2013-05-22 20:41:11 +03:00
Daniel Pavel da6711c93c the 'Solar key' on K750 is named 'Light Check button' 2013-05-21 00:48:21 +03:00
Daniel Pavel ef62892f60 pop up a desktop notification if the battery is below 5% 2013-05-18 14:35:33 +03:00
Daniel Pavel 7ae24488d9 only notify on connected devices at start-up 2013-05-18 02:20:22 +03:00
Daniel Pavel a5eeac6e5a enable notifications for peripherals; fixes #27 2013-05-17 23:06:24 +03:00
Daniel Pavel c20b279362 minor tweaks 2013-05-08 12:06:01 +03:00
Daniel Pavel 3ecfdd027e handle all 07/0D register notifications 2013-05-06 17:08:58 +02:00
Daniel Pavel 55ca9927b0 python 2/3: fix handling of first argument (unicode) of pack/unpack 2013-05-06 16:50:17 +02:00
Peter Wu 266edd80f3 Process reg07 battery notification 2013-05-03 00:10:58 +02:00
Peter Wu d1b1be32ca Make read_battery use set_battery_info
This allows battery readouts to generate warnings and debug logs for a given
status and level.
2013-05-02 23:56:08 +02:00
Peter Wu fbdd923d43 Refactor battery info update
- `self[BATTERY_STATUS] = BATTERY_STATUS[battery_status]` should be:
  `self[BATTERY_STATUS] = _hidpp20.BATTERY_STATUS[battery_status]`, otherwise
  the battery status would be a single char from the string `battery-status`.
- Make `_hidpp20.BATTERY_OK` check against strings instead of a number.
- Move setting battery information to a separate function, `set_battery_info`.
  This prepares for notifications when a battery error/warning occurs.
2013-05-02 23:51:40 +02:00
Daniel Pavel d3f94ff2fb detect some HID++1.0 custom battery notifications
they're not handled yet
2013-05-01 11:36:15 +02:00
Daniel Pavel 04db6d3838 python 3 fixes for #29 2013-04-30 22:31:06 +02:00
Daniel Pavel a57f3be58d renamed event alert levels to be more clear 2013-04-28 15:12:20 +02:00
Daniel Pavel 674ee9ac9e split read_battery in status into its own function 2013-04-28 15:01:27 +02:00
Daniel Pavel 5eab013cf6 more explicit logging 2013-04-28 14:58:40 +02:00
Daniel Pavel 079ef8d800 incipient support for the Nano receiver 2013-04-28 14:27:16 +02:00
Daniel Pavel 7707c5e558 don't notify on device disconnection 2013-01-18 17:41:45 +02:00
Daniel Pavel 36f34da227 proper debian packaging, dropper stdeb 2013-01-05 11:48:35 +02:00
Daniel Pavel 064a7a113c added setup.py for python and debian packaging 2012-12-18 05:03:43 +02:00
Daniel Pavel 430a2d71e3 read all device features as soon as the application is idle 2012-12-14 19:51:18 +02:00