diff --git a/custom_components/openevse/__init__.py b/custom_components/openevse/__init__.py index 15ae374..e730120 100644 --- a/custom_components/openevse/__init__.py +++ b/custom_components/openevse/__init__.py @@ -414,7 +414,7 @@ def parse_sensors(self) -> None: "Could not update status for %s", number, ) - data.update(_sensor) + data.update(_sensor) for light in LIGHT_TYPES: # pylint: disable=consider-using-dict-items _sensor = {} try: @@ -480,7 +480,7 @@ async def async_parse_sensors(self) -> None: "Could not update status for %s", number, ) - data.update(_sensor) + data.update(_sensor) _LOGGER.debug("DEBUG: %s", data) self._data.update(data) diff --git a/custom_components/openevse/number.py b/custom_components/openevse/number.py index be0a856..7580c89 100644 --- a/custom_components/openevse/number.py +++ b/custom_components/openevse/number.py @@ -86,7 +86,9 @@ def available(self) -> bool: attributes = ("charge_mode", "divert_active") if set(attributes).issubset(data.keys()) and self._type == "max_current_soft": if data["divert_active"] and data["charge_mode"] == "eco": - _LOGGER.debug("Disabling %s due to PV Divert being active.", self._attr_name) + _LOGGER.debug( + "Disabling %s due to PV Divert being active.", self._attr_name + ) return False return self.coordinator.last_update_success diff --git a/custom_components/openevse/select.py b/custom_components/openevse/select.py index dbe244c..4caae40 100644 --- a/custom_components/openevse/select.py +++ b/custom_components/openevse/select.py @@ -108,7 +108,9 @@ def available(self) -> bool: attributes = ("charge_mode", "divert_active") if set(attributes).issubset(data.keys()) and self._type == "max_current_soft": if data["divert_active"] and data["charge_mode"] == "eco": - _LOGGER.debug("Disabling %s due to PV Divert being active.", self._attr_name) + _LOGGER.debug( + "Disabling %s due to PV Divert being active.", self._attr_name + ) return False return self.coordinator.last_update_success diff --git a/tests/conftest.py b/tests/conftest.py index 3c9a0e6..7ece70d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -119,7 +119,7 @@ def test_charger(mock_aioclient): status=200, body='{"properties":{"state":"disabled","charge_current":28,"max_current":23,"auto_release":false},"claims":{"state":65540,"charge_current":65537,"max_current":65548}}', repeat=True, - ) + ) return main.OpenEVSE(TEST_TLD) @@ -155,7 +155,7 @@ def test_charger_bad_serial(mock_aioclient): status=200, body='{"properties":{"state":"disabled","charge_current":28,"max_current":23,"auto_release":false},"claims":{"state":65540,"charge_current":65537,"max_current":65548}}', repeat=True, - ) + ) return main.OpenEVSE(TEST_TLD) @@ -196,7 +196,7 @@ def test_charger_bad_post(mock_aioclient): status=200, body='{"properties":{"state":"disabled","charge_current":28,"max_current":23,"auto_release":false},"claims":{"state":65540,"charge_current":65537,"max_current":65548}}', repeat=True, - ) + ) return main.OpenEVSE(TEST_TLD) diff --git a/tests/test_number.py b/tests/test_number.py index eac91d5..f6001ac 100644 --- a/tests/test_number.py +++ b/tests/test_number.py @@ -85,8 +85,11 @@ async def test_number( updated_data = coordinator._data coordinator.async_set_updated_data(updated_data) await hass.async_block_till_done() - + state = hass.states.get(entity_id) assert state - assert state.state == 'unavailable' - assert "Disabling openevse Charge Rate due to PV Divert being active." in caplog.text + assert state.state == "unavailable" + assert ( + "Disabling openevse Charge Rate due to PV Divert being active." + in caplog.text + )