Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
marq24 committed Jan 23, 2025
1 parent fe5896b commit 26674ab
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions custom_components/senec/pysenec_ha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,8 @@ async def _read_senec_lala(self):
self._raw = parse(data)
except JSONDecodeError as exc:
_LOGGER.warning(f"JSONDecodeError while 'await res.json()' {exc}")
except Exception as err:
_LOGGER.warning(f"read_senec_lala caused: {err}")

async def read_all_fields(self) -> []:
async with self.web_session.post(self.url, json={"DEBUG": {"SECTIONS": ""}}, ssl=False) as res:
Expand Down Expand Up @@ -2261,8 +2263,8 @@ async def write_senec_v31(self, data):
self._raw_post = parse(await res.json())
_LOGGER.debug(f"post result (already parsed): {util.mask_map(self._raw_post)}")
return self._raw_post
except Exception as exc:
_LOGGER.warning(f"JSONDecodeError while 'await res.json()' {exc}")
except Exception as err:
_LOGGER.warning(f"Error while 'posting data' {err}")

async def senec_v31_safe_charge(self, form_data:str):
_LOGGER.debug(f"posting x-www-form-urlencoded: {form_data}")
Expand Down Expand Up @@ -2290,8 +2292,8 @@ async def senec_v31_safe_charge(self, form_data:str):
self._raw_post = parse(await res.json())
_LOGGER.debug(f"post result (already parsed): {util.mask_map(self._raw_post)}")
return self._raw_post
except Exception as exc:
_LOGGER.warning(f"JSONDecodeError while 'await res.json()' {exc}")
except Exception as err:
_LOGGER.warning(f"Error while 'posting data' {err}")

class Inverter:
"""Senec Home Inverter addon"""
Expand Down

0 comments on commit 26674ab

Please sign in to comment.