mirror of
https://github.com/dguglielmi/sunny-overlay.git
synced 2025-12-06 09:32:37 +01:00
55 lines
1.6 KiB
Diff
55 lines
1.6 KiB
Diff
From 65564128f254a2b0d1923d524f2155a19d985d57 Mon Sep 17 00:00:00 2001
|
|
From: Jente Hidskes <hjdskes@gmail.com>
|
|
Date: Thu, 31 Aug 2017 11:57:27 +0200
|
|
Subject: [PATCH 10/30] piper/ratbagd.py: sync with libratbag
|
|
|
|
---
|
|
piper/ratbagd.py | 24 ++++++++++++++++++++++++
|
|
1 file changed, 24 insertions(+)
|
|
|
|
diff --git a/piper/ratbagd.py b/piper/ratbagd.py
|
|
index 05d3408..5f889aa 100644
|
|
--- a/piper/ratbagd.py
|
|
+++ b/piper/ratbagd.py
|
|
@@ -389,6 +389,8 @@ class RatbagdDevice(_RatbagdDBus):
|
|
class RatbagdProfile(_RatbagdDBus):
|
|
"""Represents a ratbagd profile."""
|
|
|
|
+ CAP_WRITABLE_NAME = 100
|
|
+
|
|
def __init__(self, object_path):
|
|
_RatbagdDBus.__init__(self, "Profile", object_path)
|
|
self._dirty = False
|
|
@@ -425,6 +427,28 @@ class RatbagdProfile(_RatbagdDBus):
|
|
self.notify("is-active")
|
|
self._on_obj_notify(None, None)
|
|
|
|
+ @GObject.Property
|
|
+ def capabilities(self):
|
|
+ """The capabilities of this profile as an array. Capabilities not
|
|
+ present on the profile are not in the list. Thus use e.g.
|
|
+
|
|
+ if RatbagdProfile.CAP_WRITABLE_NAME is in profile.capabilities:
|
|
+ do something
|
|
+ """
|
|
+ return self._get_dbus_property("Capabilities")
|
|
+
|
|
+ @GObject.property
|
|
+ def name(self):
|
|
+ """The name of the profile"""
|
|
+ return self._get_dbus_property("Name")
|
|
+
|
|
+ @name.setter
|
|
+ def name(self, name):
|
|
+ """Set the name of this profile.
|
|
+
|
|
+ @param name The new name, as str"""
|
|
+ self._set_dbus_property("Name", "s", name)
|
|
+
|
|
@GObject.Property
|
|
def index(self):
|
|
"""The index of this profile."""
|
|
--
|
|
2.16.1
|
|
|