Rename current_consumption to power

- Note: This is a breaking change.
- Fix: Rename `current_consumption` to `power` in energy modules, to deconflict and clarify.
- Fix: Report `0` instead of `None` for current when current is zero.
- Fix: Report `0` instead of `None` for voltage when voltage is zero (not that this was possible to see).
This commit is contained in:
Ryan Nitcher
2024-12-06 20:48:16 -07:00
parent cb89342be1
commit 1c250913b6
8 changed files with 22 additions and 21 deletions

View File

@@ -133,9 +133,9 @@ async def test_erase_emeter_stats(dev):
@has_emeter_iot
async def test_current_consumption(dev):
async def test_power(dev):
emeter = dev.modules[Module.Energy]
x = emeter.current_consumption
x = emeter.power
assert isinstance(x, float)
assert x >= 0.0