niemyjski / homeassistant-kohler

Kohler Integration for Home Assistant
Apache License 2.0
14 stars 3 forks source link

Exception on setup #2

Closed jwelter1971 closed 4 years ago

jwelter1971 commented 4 years ago

See logs below. This could be because I am configured as celsius?

Note: the 38.0 is the correct set point so it is talking to my DTV+

Error while setting up platform kohler
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 158, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/kohler/water_heater.py", line 32, in setup_platform
    add_entities([KohlerWaterHeater(Kohler, sysInfo, values)])
  File "/config/custom_components/kohler/water_heater.py", line 49, in __init__
    self._target_temperature = self.getTargetTemp(sysInfo, values)
  File "/config/custom_components/kohler/water_heater.py", line 180, in getTargetTemp
    temps.append(int(sysInfo[name]))
ValueError: invalid literal for int() with base 10: '38.0'
niemyjski commented 4 years ago

Nice find, I think I need to convert to float and also see what home assistant is expecting. I’m traveling this week but will try and get this fixed soon

niemyjski commented 4 years ago

You may want to try editing that file and change that it from int to float.

jwelter1971 commented 4 years ago

I changed both getCurrentTemp and getTargetTemp to floats and up and running.

niemyjski commented 4 years ago

I just pushed a major refactor, can you please let me know if you run into any issues. I set it so the current temp isn't populated until the shower is turned on. I also, made it so increasing and decreasing the shower temp doesn't turn it on, set operation is required.