-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add option to import faders as media players #83
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By adding the new config parameter, you should probably also take care of that in the async_migrate_entry function in init.py to make sure it is added to all existing users.
@@ -177,6 +179,16 @@ def fader_group(self, entities, entity_type, index_number, base_key, name=""): | |||
"base_address": base_address, | |||
} | |||
) | |||
if self.config_entry.data.get("FADER_MEDIA_PLAYERS"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is the right way to do this.
If you are wanting the faders as media players, then you are probably unlikely to want them also as numbers/switches, your approach here duplicates them.
I think this would better become:
if self.config_entry.data.get("FADER_MEDIA_PLAYERS"):
- media player config
else - switch/number config
IF DB sensors
...
Essentially just moving the existing code to an else of your new 'if'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did start with doing that, but changed it because I wanted mute only entities for some things. But maybe I can avoid that by adjusting how the automation works..
My use case here is that I have some ha panels like this:
Each slider is a channel to bus send (some are bus to matrix). The 'master' is toggling the 'main' mute of the bus/matrix. I have some automations reacting to that changing to power on/off speakers which are fed from this bus/matrix.
Now that I think about it, I don't remember if I wanted to mute the bus/matrix of if it was just a convenient abstraction from the physical switch to make it easier to handle that changing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose the other option, is to change the configuration to be a dropdown something like:
- Expose faders as:
- Numbers and Switches (Default)
- Media Players
- Both Numbers and Switches and Media players (duplication)
This gives the ability for the user to have either (or both) options.
Thanks for this project, I have been wondering about making something like this myself but don't know python (or home assistant integrations) well enough to know where to begin. For a few years I have been using a custom tool which bridged the x32 to mqtt and a muddled together way of exposing that as a media-player entity, but it needed some fixing with newer ha then I stumbled upon your project.
One thing I much prefer is having each fader and mute state being exposed as a media-player entity instead of as a number and a switch. This gives it a nicer presentation in the default ha dashboards.
So this PR adds an option during configuration which will set it up to produce a single media_player entity instead of a number and switch for each fader.
Additionally, I have set the step value for the number faders, so that they can be set more granularly from the ha ui.