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

Allow redefine autodiscovery type #4647

Merged
merged 2 commits into from
Oct 13, 2020

Conversation

brokenmass
Copy link
Contributor

@brokenmass brokenmass commented Oct 12, 2020

Unfortunately the previous PR (#4593 ) was incorrect as it was merging the type and object_id into the payload instead of the config.
This solves the issue by moving the type/object_id override logic to the right place, the getConfigs method

@brokenmass brokenmass force-pushed the allow_redefine_autodiscovery_type branch 6 times, most recently from 4a3b377 to 666b1e0 Compare October 12, 2020 17:42
@Koenkk
Copy link
Owner

Koenkk commented Oct 12, 2020

I'm wondering if exposing a switch as a light is the only use case for overriding. If that is the case I would prefer to rather introduce a switch for this. e.g.

devices:
  '0x12345678':
    friendly_name: my_switch
    homeassistant:
      switch_as_light: true

@brokenmass
Copy link
Contributor Author

brokenmass commented Oct 12, 2020

I don't think it's the only case. I can imagine it being used to configure switch as locks, or locks as switches, but yes it's a configuration that mostly affect switches (and other binary actuators).
I personally find a switch_as_light entry inside homeassistant a bit dirty as all the others values are overrides while that is a functionality toggle. Also it doesn't allow for multi-gang switches specific configuration (ie: 1 switch mapped as light the other left as switch)
The proposed solution instead allow for maximun configurability and it can be considered an advanced override, for people that want to control zigbee2mqtt exposed devices directly from z2m without using ha devices aliases.

@brokenmass brokenmass force-pushed the allow_redefine_autodiscovery_type branch 2 times, most recently from 6bd89aa to 9ad4b53 Compare October 12, 2020 22:38
@brokenmass brokenmass force-pushed the allow_redefine_autodiscovery_type branch from 9ad4b53 to 8a4845c Compare October 13, 2020 12:26
@brokenmass
Copy link
Contributor Author

@Koenkk : are you happy to merge this ?

Koenkk added a commit to Koenkk/zigbee2mqtt.io that referenced this pull request Oct 13, 2020
@Koenkk
Copy link
Owner

Koenkk commented Oct 13, 2020

@Koenkk Koenkk merged commit e63a2ac into Koenkk:dev Oct 13, 2020
Koenkk added a commit to Koenkk/zigbee2mqtt.io that referenced this pull request Nov 1, 2020
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