refactor gainlayers and bus gains

This commit is contained in:
2026-01-17 13:19:43 +00:00
parent ad88286509
commit efdcfce387
3 changed files with 29 additions and 67 deletions

View File

@@ -24,14 +24,11 @@ class Bus(IRemote):
@property
def gain(self) -> float:
def fget():
val = self.public_packets[NBS.zero].busgain[self.index]
if 0 <= val <= 1200:
return val * 0.01
return (((1 << 16) - 1) - val) * -0.01
val = self.getter('gain')
return round(val if val else fget(), 1)
if val:
return round(val, 2)
else:
return self.public_packets[NBS.zero].busgain[self.index]
@gain.setter
def gain(self, val: float):