diff --git a/custom_components/alfen_wallbox/alfen.py b/custom_components/alfen_wallbox/alfen.py index 354ee12..4e368da 100644 --- a/custom_components/alfen_wallbox/alfen.py +++ b/custom_components/alfen_wallbox/alfen.py @@ -140,8 +140,8 @@ def _post(self, cmd, payload=None, allowed_login=True): self.login() return self._post(cmd, payload, False) response.raise_for_status() - if len(response.text) > 0: - return response.json() + if response: + return response def _get(self, url, allowed_login=True): response = self._session.get(url, timeout=5) @@ -169,7 +169,7 @@ def logout(self): def _update_value(self, api_param, value): response = self._post(cmd=PROP, payload={api_param: { - ID: api_param, VALUE: value}}) + ID: api_param, VALUE: str(value)}}) _LOGGER.debug(f"Set {api_param} value {value} response {response}") def _get_value(self, api_param): diff --git a/custom_components/alfen_wallbox/select.py b/custom_components/alfen_wallbox/select.py index d917ae6..3c4efa6 100644 --- a/custom_components/alfen_wallbox/select.py +++ b/custom_components/alfen_wallbox/select.py @@ -301,6 +301,7 @@ class AlfenSelect(AlfenEntity, SelectEntity): """Define Alfen select.""" values_dict: dict[int, str] + entity_description: AlfenSelectDescription def __init__( self, device: AlfenDevice, description: AlfenSelectDescription