Closed mbauwens closed 2 years ago
Maybe not the most robust solution, but I did manage to fix it manually in my own files by editing sensor.py
:
Suggestion via pr: #7
if data_json['out_of_salt'] == "Today":
self._attrs[ATTR_OUT_OF_SALT_ON] = "Today"
else:
if self._dateformat == "dd/mm/yyyy":
self._attrs[ATTR_OUT_OF_SALT_ON] = datetime.strptime(data_json['out_of_salt'], '%d/%m/%Y').strftime('%Y-%m-%d')
elif self._dateformat == "mm/dd/yyyy":
self._attrs[ATTR_OUT_OF_SALT_ON] = datetime.strptime(data_json['out_of_salt'], '%m/%d/%Y').strftime('%Y-%m-%d')
else:
self._attrs[ATTR_OUT_OF_SALT_ON] = ''
_LOGGER.exception(
f"Error: Date format not set"
)
Fixing it now! Sorry I haven't been very active lately.
Thanks 👍
When the EcoWater softener is out of salt, it throws an error because the output is just "Today" and not a date format: