Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fan.py #1167

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Update fan.py #1167

merged 1 commit into from
Dec 11, 2023

Conversation

sfortis
Copy link
Contributor

@sfortis sfortis commented Dec 8, 2023

This will fix the error coming from Mushroom Fan card "SmartIRFan.async_turn_on() takes from 1 to 2 positional arguments but 3 were given" since is passing also the "preset_mode".

@honcheng
Copy link

@sfortis what’s ‘mushroom fan card’? I’m not using that, but getting the same error. Suddenly encounter this problem this morning, though the last time I did any update was 3 days ago.

@sfortis
Copy link
Contributor Author

sfortis commented Dec 11, 2023

@honcheng, this may have to do with the latest thermostat changes in 2023.12. SmartIR cannot handle presets, so with my PR, this is simply ignored even if it is passed to SmartIRFan.async_turn_on(), thus making service fan.turn_on operational again.

I thought that this was a problem with the mushroom fan card (https://github.com/piitaya/lovelace-mushroom/blob/main/docs/cards/fan.md), but you're right; the service itself is failing."

File "/usr/src/homeassistant/homeassistant/components/fan/init.py", line 305, in async_handle_turn_on_service
await self.async_turn_on(percentage, preset_mode, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: SmartIRFan.async_turn_on() takes from 1 to 2 positional arguments but 3 were given

@vassilis-panos vassilis-panos merged commit e49543c into smartHomeHub:master Dec 11, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants