Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add persistence storage #1149

Merged
merged 1 commit into from Nov 12, 2020
Merged

Add persistence storage #1149

merged 1 commit into from Nov 12, 2020

Conversation

lah7
Copy link
Member

@lah7 lah7 commented May 15, 2020

It's #888 plus some finishing touches. All tasks have been completed and it's working well - ready for a final review.

There are no open issues to close on this repository - the mentioned open issues are for front-ends.

Worth mentioning in the release notes:

  • Lighting settings are retained across reboots.
    • This will cause your devices to reset to spectrum initially.
    • Applications will require an update to support this feature.
  • Some devices (such as Chroma HDK and Base Station Chroma) no longer report 0% brightness.

@chabad360
Copy link
Contributor

A known issue is that this doesn't monitor DPI changes via hardware buttons, so this won't be persisted until the state is updated via the API.

...or until #1124 is merged (which would allow for handling the buttons in userspace))

Well, it depends on how the buttons report, I only monitor hardware events that trigger evdev (i.e. keypress events), so it's not that simple...

@tildearrow
Copy link
Contributor

I wonder what happened to this branch?...

It's been a while since it was last updated.

@z3ntu
Copy link
Member

z3ntu commented Sep 26, 2020

Error with e.g. Kraken Ultimate: (see #1266, polychromatic/polychromatic#287)

import openrazer.client as rclient
device = rclient.DeviceManager().devices[0]  # First device
device.fx.breath_single(255,255,255)
device.fx.breath_dual(255,255,255, 128,128,128)
device.fx.breath_triple(255,255,255, 128,128,128, 255,255,255)
device.fx.breath_dual(255,255,255, 128,128,128)  # Error happens
Traceback (most recent call last):
  File "a.py", line 6, in <module>
    device.fx.breath_dual(255,255,255, 128,128,128)  # Error happens
  File "/usr/lib/python3.8/site-packages/openrazer/client/fx.py", line 277, in breath_dual
    self._lighting_dbus.setBreathDual(red, green, blue, red2, green2, blue2)
  File "/usr/lib/python3.8/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/lib/python3.8/site-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.TypeError: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/dbus/service.py", line 711, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/home/luca/dev/razer/openrazer/daemon/openrazer_daemon/dbus_services/dbus_methods/chroma_keyboard.py", line 479, in set_breath_dual_effect
    self.zone["backlight"]["colors"][0:6] = int(red1), int(green1), int(blue1), int(red2), int(green2), int(blue2)
TypeError: 'tuple' object does not support item assignment

Copy link
Contributor

@kevchu3 kevchu3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled this commit and tested, and was successfully able to resolve #1266

@z3ntu z3ntu requested review from z3ntu and removed request for z3ntu October 14, 2020 08:52
@tildearrow

This comment has been minimized.

@z3ntu

This comment has been minimized.

@tildearrow

This comment has been minimized.

@kevchu3
Copy link
Contributor

kevchu3 commented Nov 9, 2020

Would we be able to get this PR merged into master?

This patch adds several D-Bus methods for accessing the current state of
the devices (plus pylib API for the new functionality):
* get*Effect
* get*EffectColors
* get*EffectSpeed
* get*WaveDir
* restoreLastEffect

The star means e.g. getEffect, getLogoEffect, getScrollEffect, etc.

The last one can be used to reset to the previous effect after setting a
custom effect (which won't be persisted).

Co-authored-by: Luke Horwell <code@horwell.me>
Co-authored-by: Luca Weiss <luca@z3ntu.xyz>
@z3ntu z3ntu merged commit 03df9f3 into master Nov 12, 2020
@z3ntu z3ntu deleted the effect_storage branch November 12, 2020 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants