diff --git a/custom_components/ocpp/api.py b/custom_components/ocpp/api.py index 81c87aec..60b026e8 100644 --- a/custom_components/ocpp/api.py +++ b/custom_components/ocpp/api.py @@ -894,7 +894,7 @@ async def get_configuration(self, key: str = ""): else: req = call.GetConfiguration(key=[key]) resp = await self.call(req) - if resp.configuration_key is not None: + if resp.configuration_key: value = resp.configuration_key[0][om.value.value] _LOGGER.debug("Get Configuration for %s: %s", key, value) self._metrics[cdet.config_response.value].value = datetime.now( @@ -902,7 +902,7 @@ async def get_configuration(self, key: str = ""): ) self._metrics[cdet.config_response.value].extra_attr = {key: value} return value - if resp.unknown_key is not None: + if resp.unknown_key: _LOGGER.warning("Get Configuration returned unknown key for: %s", key) await self.notify_ha(f"Warning: charger reports {key} is unknown") return None