mirror of
https://github.com/bckelley/tconnectsync.git
synced 2026-08-24 03:34:12 -05:00
attempt to fix batteryChargePercent
This commit is contained in:
@@ -4495,7 +4495,7 @@ class LidDailyBasal(BaseEvent):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def batteryChargePercent(self):
|
def batteryChargePercent(self):
|
||||||
return (256*(self.batterychargepercentmsbRaw%2)+self.batterychargepercentlsbRaw)/512
|
return (256*(self.batterychargepercentmsbRaw-14)+self.batterychargepercentlsbRaw)/(3*256)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def build(raw):
|
def build(raw):
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ def transform_battery_charge_percent(event_def, name, name_fmt, field, tx):
|
|||||||
out += [
|
out += [
|
||||||
'@property',
|
'@property',
|
||||||
f'def batteryChargePercent(self):',
|
f'def batteryChargePercent(self):',
|
||||||
f' return (256*(self.batterychargepercentmsbRaw%2)+self.batterychargepercentlsbRaw)/512',
|
f' return (256*(self.batterychargepercentmsbRaw-14)+self.batterychargepercentlsbRaw)/(3*256)',
|
||||||
''
|
''
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user