ha-dyson: Can No Longer Turn Off Fan in Auto Mode

As a byproduct of Issue https://github.com/shenxn/ha-dyson/issues/12 (v0.5.1) when the Fan is in the Auto Mode preset it can no longer be shutoff. I agree with the logic that Auto Mode should still report the device as On, however even at that state you can not shut the fan off completely and will remain in auto mode as “On” unless the fan percentage is changed to another value to remove the “Auto” preset. I think a preset mode of “None” or “Off” that is a valid option might resolve it slightly being able to remove it from “Auto” without setting a fan percentage. Or if a fan.turn_off is issued shut the fan down and remove it from auto mode.

Example fan.turn_off on an entity in Auto Mode continues to stay on and in Auto mode Log Error:

2021-03-09 12:55:24 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 282, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 321, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 602, in state_attributes
    data[ATTR_SPEED] = self.speed
  File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 452, in speed
    percentage = self.percentage
  File "/config/custom_components/dyson_local/fan.py", line 119, in percentage
    return ranged_value_to_percentage(SPEED_RANGE, int(self._device.speed))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (6 by maintainers)

Most upvoted comments

Thanks for the help. Fixed in version 0.8.1