|
|
@ -1,4 +1,5 @@ |
|
|
|
import os |
|
|
|
import os |
|
|
|
|
|
|
|
from functools import cached_property |
|
|
|
from enum import IntEnum |
|
|
|
from enum import IntEnum |
|
|
|
import subprocess |
|
|
|
import subprocess |
|
|
|
from pathlib import Path |
|
|
|
from pathlib import Path |
|
|
@ -51,13 +52,20 @@ def write_amplifier_reg(reg, val, offset, mask): |
|
|
|
v = (v & (~mask)) | ((val << offset) & mask) |
|
|
|
v = (v & (~mask)) | ((val << offset) & mask) |
|
|
|
bus.write_byte_data(AMP_ADDRESS, reg, v, force=True) |
|
|
|
bus.write_byte_data(AMP_ADDRESS, reg, v, force=True) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Tici(HardwareBase): |
|
|
|
class Tici(HardwareBase): |
|
|
|
def __init__(self): |
|
|
|
@cached_property |
|
|
|
|
|
|
|
def bus(self): |
|
|
|
import dbus # pylint: disable=import-error |
|
|
|
import dbus # pylint: disable=import-error |
|
|
|
|
|
|
|
return dbus.SystemBus() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cached_property |
|
|
|
|
|
|
|
def nm(self): |
|
|
|
|
|
|
|
return self.bus.get_object(NM, '/org/freedesktop/NetworkManager') |
|
|
|
|
|
|
|
|
|
|
|
self.bus = dbus.SystemBus() |
|
|
|
@cached_property |
|
|
|
self.nm = self.bus.get_object(NM, '/org/freedesktop/NetworkManager') |
|
|
|
def mm(self): |
|
|
|
self.mm = self.bus.get_object(MM, '/org/freedesktop/ModemManager1') |
|
|
|
return self.bus.get_object(MM, '/org/freedesktop/ModemManager1') |
|
|
|
|
|
|
|
|
|
|
|
def get_os_version(self): |
|
|
|
def get_os_version(self): |
|
|
|
with open("/VERSION") as f: |
|
|
|
with open("/VERSION") as f: |
|
|
|