logitech_receiver: allow volatile writes

Volatile writes allow writing values to the device, but not to the
configuration and cache. This allows applying temporary settings and
restoring the original setting later.
This commit is contained in:
jkhsjdhjs 2026-07-02 20:06:28 +02:00
parent b2afd88129
commit 3b931dc313
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -156,7 +156,7 @@ class Setting:
self._value = value
self._pre_write(save)
def write(self, value, save=True):
def write(self, value, save=True, volatile=False):
assert hasattr(self, "_value")
assert hasattr(self, "_device")
assert value is not None
@ -165,7 +165,7 @@ class Setting:
logger.debug("%s: write %r to %s", self.name, value, self._device)
if self._device.online:
if self._value != value:
if self._value != value and not volatile:
self.update(value, save)
current_value = None