mirror of
https://git.disroot.org/pranav/pybatmesh.git
synced 2024-11-27 01:02:15 +05:30
Added class Adapter in iwd.py
Initial implementation. No useful public methods yet
This commit is contained in:
parent
3c22fa63f4
commit
809c09afe0
@ -197,4 +197,17 @@ class Device:
|
||||
self._proxy.StartOpen(name)
|
||||
|
||||
|
||||
# TODO: make a class Adapter with power_on() and power_off()
|
||||
# TODO: add power_on() and power_off()
|
||||
class Adapter:
|
||||
"""represents an adapter as a python object"""
|
||||
|
||||
def __init__(self, name: str, bus=SystemMessageBus()):
|
||||
self._iwd = IWD(bus)
|
||||
self._bus = self._iwd._bus
|
||||
self._path = self._iwd.get_adapter_path_from_name(name)
|
||||
# Initialise self._proxy
|
||||
self.reload()
|
||||
|
||||
def reload(self):
|
||||
"""reload the proxy after changing mode"""
|
||||
self._proxy = self._bus.get_proxy(IWD_BUS, self._path)
|
||||
|
Loading…
Reference in New Issue
Block a user