Include charging state for powerwall (#33432)

* Switch to binary sensor for charging status per review

* Powerwall charging margin of error is much higher than expected
This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-04-19 20:50:42 -05:00
1 parent 675525f47c
commit 75e5f085d3
3 files changed
+51 -1

No files matched your search

@@ -52,3 +52,13 @@ async def test_sensors(hass):
# Only test for a subset of attributes in case
# HA changes the implementation and a new one appears
assert all(item in state.attributes.items() for item in expected_attributes.items())
state = hass.states.get("binary_sensor.powerwall_charging")
assert state.state == STATE_ON
expected_attributes = {
"friendly_name": "Powerwall Charging",
"device_class": "battery_charging",
}
# Only test for a subset of attributes in case
# HA changes the implementation and a new one appears
assert all(item in state.attributes.items() for item in expected_attributes.items())