Fix attributes

This commit is contained in:
Pascal Vizeli 2018-04-25 23:24:55 +02:00
parent 70ac395232
commit 9041eb9e9a

View File

@ -101,12 +101,13 @@ class DBus:
# Parse and return data # Parse and return data
return self._gvariant(data) return self._gvariant(data)
def get_properties(self, interface): async def get_properties(self, interface):
"""Read all properties from interface. """Read all properties from interface."""
try:
Return a coroutine. return await self.call_dbus(DBUS_METHOD_GETALL, interface)[0]
""" except IndexError:
return self.call_dbus(DBUS_METHOD_GETALL, interface) _LOGGER.error("No attributes returned for %s", interface)
raise DBusFatalError from None
async def _send(self, command): async def _send(self, command):
"""Send command over dbus.""" """Send command over dbus."""