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

Saxel Fan Updates #1116

Merged
merged 4 commits into from
Feb 28, 2023
Merged

Saxel Fan Updates #1116

merged 4 commits into from
Feb 28, 2023

Conversation

benbur98
Copy link
Contributor

@benbur98 benbur98 commented Dec 7, 2022

I have worked on a few updates to @saxel fan card.
Have incorporated some of @sildehoop work with the percentage/humidity labels (these can be optioned out if not desired), from his PR #134

I have added the option to remove the Oscillation button as requested in #107 . With changing the Service of this button it is more complicated, could someone with an air purifier comment on what service (and it's data) they would specifically like - I have started to add this option but currently only oscillation will work (as previous) as i haven't added anything to change the Service data.

Planning on implementing the Horizontal card layout also.

@benbur98
Copy link
Contributor Author

benbur98 commented Dec 8, 2022

Quick and dirty Horizontal Mode added.
As mentioned in #134 , I think the card needs rebasing off of the Light card as it is significantly different in what is fairly similar operation. Will look into this.

@shift-del1
Copy link

@benbur98: I have Xiaomi Mi Air Purifier 2S and 3, so I can do the tests. From my point of view the only reasonable servise to be assigned to the button would be the looping between presets, this is what the button/touch screen does too. One press, Auto, press again, Silent, press again Manual/Favorite and so on (or if there are levels, those ones). In my case the attributes are the following:
preset_modes:
- Auto
- Silent
- Favorite
- Idle/Fan (2S/3)
preset_mode: Favorite
so fan.set_preset_mode would seem to be the right choice (personally I don't modify the preset manually). Favorite and Fan modes have number entities, so long pressing the button could be used to alter somehow the number entity assigned to that specific mode (through number.set_value). These are just ideas, persionally I would remove the button completely 😊

@benbur98
Copy link
Contributor Author

benbur98 commented Dec 9, 2022

Thanks for the info. Implementing auto mode toggle should be doable. The trouble really is keeping it consistent between different fans - unfortunately there is no ‘get available presets’ option so without restricting it by variables it’s a very specific option.
Also I have added the option to remove the button now if you like.

@shift-del1
Copy link

@benbur98 I replaced the yaml with yours, but I got an error for label (I defined the variables for temp and hum attributes and the one to remove the button. After hardcoded a value for label, I got this:
TypeError: Cannot assign to read only property '0' of object '[object Array]'
Any suggestion where did I go wrong? Thank you.

@benbur98
Copy link
Contributor Author

benbur98 commented Jan 2, 2023

@shift-del1 Thanks for checking this out. How did you define the variables, can you share your YAML? Also what do you mean by 'hardcoded a value for label'.

@benbur98
Copy link
Contributor Author

benbur98 commented Jan 2, 2023

Note: This check is only spelling due to the spelling of 'Collapsable' in the Doc - I Have spelt it this way as changing the variable spelling to be correct 'Collapsible' is not worth the breaking change.

@shift-del1
Copy link

@benbur98: I reverted back my config to the original fan card, so I can not show my YAML (sorry). "Hardcoded" means I replaced the label section with a string (so skipped the whole function which defines the string to show as a label). Technically it should simplyfy the card while loosing its flexibility, but for my test it should have been enough (but it wasn't :-D). I'm sure it is hard to help without data, just wanted to ask if you faced the same previously.

@basbruss basbruss merged commit 5c20540 into UI-Lovelace-Minimalist:main Feb 28, 2023
@benbur98 benbur98 deleted the saxel-fan-oscillate branch February 28, 2023 10:44
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.

None yet

4 participants