syssi / xiaomi_cooker

Xiaomi Mi Electric Rice Cooker integration for Home Assistant
Apache License 2.0
141 stars 37 forks source link

MI Rice Cooker error in KeepWarm #4

Closed pauligbrest closed 5 years ago

pauligbrest commented 5 years ago

019-02-09 14:28:02 ERROR (MainThread) [custom_components.sensor.xiaomi_cooker] Exception in async_update_callback when dispatching 'xiaomi_cooker_updated': ('192.168.88.14',)

Traceback (most recent call last):

File "/config/custom_components/sensor/xiaomi_cooker.py", line 98, in async_update_callback

temperature_history is not None:

IndexError: pop from empty list

syssi commented 5 years ago

Please update this component and try again. :-)

ktpx commented 5 years ago

I'm getting the same issue.

pauligbrest commented 5 years ago

Please update this component and try again. :-)

I update this component. But the same issue

ktpx commented 5 years ago

The update was only to restructure the files into the new tree layout in homeassistant. Nothing that would fix this bug.

ktpx commented 5 years ago

Changing the code to:

            if self._attr == 'temperature' and \
                    state.mode in [OperationMode.Running, OperationMode.AutoKeepWarm] and \
                    temperature_history.temperatures:   
                            self._state = temperature_history.temperatures.pop()

clears the error, but no temperature is shown still. I think it might not get the temp history from the cooker during autowarm?