mirror of
https://github.com/meshtastic/python.git
synced 2026-05-19 05:46:14 -04:00
PPK2 based power measurements seem to approximately work
This commit is contained in:
@@ -9,8 +9,8 @@ from .power_supply import PowerSupply
|
||||
class SimPowerSupply(PowerSupply):
|
||||
"""A simulated power supply for testing."""
|
||||
|
||||
def getAverageWatts(self) -> float:
|
||||
"""Get the total amount of power that is currently being consumed."""
|
||||
def get_average_current_mA(self) -> float:
|
||||
"""Returns average current of last measurement in mA (since last call to this method)"""
|
||||
|
||||
# Sim a 20mW load that varies sinusoidally
|
||||
return (20 + 5 * math.sin(time.time())) / 1000
|
||||
return (20.0 + 5 * math.sin(time.time()))
|
||||
|
||||
Reference in New Issue
Block a user