Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Setting preset not working for non numeric preset on ac1214 #41

Open
SgtZapper opened this issue Apr 17, 2021 · 4 comments
Open

Setting preset not working for non numeric preset on ac1214 #41

SgtZapper opened this issue Apr 17, 2021 · 4 comments

Comments

@SgtZapper
Copy link

SgtZapper commented Apr 17, 2021

Noticed that setting speed 1,2,3 works but no other preset on the AC1214/10.

I'm running on:
Home Assistant OS 5.13
supervisor-2021.04.0
core-2021.4.5

Got it to work by crudely changing the async_set_preset_mode method in fan.py to the code below so that it sets the data individually.
I looked in the client and see no real reason the original commented code should not work. (I'm bad with python just fyi).

async def async_set_preset_mode(self, preset_mode: str) -> None:
        """Set the preset mode of the fan."""
        status_pattern = self._available_preset_modes.get(preset_mode)
        if status_pattern:
             """Set the values one by one."""
            await self._client.set_control_value(PHILIPS_POWER, "1")
            await self._client.set_control_value(PHILIPS_MODE, status_pattern.get(PHILIPS_MODE))
            if status_pattern.get(PHILIPS_SPEED):
                await self._client.set_control_value(PHILIPS_SPEED, status_pattern.get(PHILIPS_SPEED))

#original code            await self._client.set_control_values(data=status_pattern)

It works but it doesn't report back turbo when setting it to turbo mode the attribute just becomes blank.

@SamJongenelen
Copy link

I have the same model and same issue; setting int value works but string doesn't

@MSOHD
Copy link

MSOHD commented Aug 8, 2021

I also have that problem. But sadly your fix doesn't help me at all. Do I have to pay attention to something special? Can you please show your whole fan.py ? That would help me a lot :)

@SgtZapper
Copy link
Author

SgtZapper commented Sep 13, 2021

I might have ran HACS and deleted my changes and my purifier is in for service atm (it started showing high values then it was dead) so I have nothing to test against. Will test when I get it back. But I'm sure my solution was a permanent one.

@SgtZapper SgtZapper reopened this Sep 13, 2021
@kongo09
Copy link

kongo09 commented Apr 7, 2022

I've tried my hand at a rewrite. Please let me know if that works for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants