fix: solar forecast charging
This commit is contained in:
@@ -145,41 +145,6 @@ class TestApplyStopHysteresis:
|
||||
assert result == 0
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# _get_solar_excess_w
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
class TestGetSolarExcessW:
|
||||
def test_valid_numeric_state(self, coord):
|
||||
coord.hass.states.get.return_value = make_state("3500.5")
|
||||
assert coord._get_solar_excess_w() == 3500.5
|
||||
|
||||
def test_integer_state(self, coord):
|
||||
coord.hass.states.get.return_value = make_state("5000")
|
||||
assert coord._get_solar_excess_w() == 5000.0
|
||||
|
||||
def test_unavailable_returns_none(self, coord):
|
||||
coord.hass.states.get.return_value = make_state("unavailable")
|
||||
assert coord._get_solar_excess_w() is None
|
||||
|
||||
def test_unknown_returns_none(self, coord):
|
||||
coord.hass.states.get.return_value = make_state("unknown")
|
||||
assert coord._get_solar_excess_w() is None
|
||||
|
||||
def test_missing_entity_returns_none(self, coord):
|
||||
coord.hass.states.get.return_value = None
|
||||
assert coord._get_solar_excess_w() is None
|
||||
|
||||
def test_non_numeric_returns_none(self, coord):
|
||||
coord.hass.states.get.return_value = make_state("not_a_number")
|
||||
assert coord._get_solar_excess_w() is None
|
||||
|
||||
def test_queries_correct_entity(self, coord):
|
||||
coord.hass.states.get.return_value = make_state("1000")
|
||||
coord._get_solar_excess_w()
|
||||
coord.hass.states.get.assert_called_once_with(coord._solar_excess_sensor)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# _charger_allows_control
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user