Skip to content

Improve composite exposes #1638

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

Merged
merged 2 commits into from
Jan 13, 2023
Merged

Improve composite exposes #1638

merged 2 commits into from
Jan 13, 2023

Conversation

Koenkk
Copy link
Collaborator

@Koenkk Koenkk commented Dec 23, 2022

For: Koenkk/zigbee-herdsman-converters#5058 and Koenkk/zigbee-herdsman-converters#5298 (CC: @protyposis, @mdziekon)

  • Removes the apply button for nested composites (one apply button on the root composite is always shown now)
  • Fix apply button always greyed out for nested composites, apply button on root composite will be enabled when all child composites are filled in
  • Used the following expose (requires a small change in zigbee-herdsman-converters, access needs to be added for composite)
exposes.composite('schedule_settings_composite', 'schedule_settings_composite', ea.ALL)
    .withFeature(exposes.composite('Days', 'days')
        .withFeature(exposes.switch().withState('mon', true, undefined, ea.STATE_SET))
        .withFeature(exposes.switch().withState('tue', true, undefined, ea.STATE_SET))
        .withFeature(exposes.switch().withState('wed', true, undefined, ea.STATE_SET))
        .withFeature(exposes.switch().withState('thu', true, undefined, ea.STATE_SET))
        .withFeature(exposes.switch().withState('fri', true, undefined, ea.STATE_SET))
        .withFeature(exposes.switch().withState('sat', true, undefined, ea.STATE_SET))
        .withFeature(exposes.switch().withState('sun', true, undefined, ea.STATE_SET)),
    )
    .withFeature(exposes.composite('Start', 'start')
        .withFeature(exposes.numeric('Hour', ea.STATE_SET).withProperty('hour'))
        .withFeature(exposes.numeric('Minute', ea.STATE_SET).withProperty('minute'))
        .withFeature(exposes.numeric('Temperature', ea.STATE_SET).withProperty('temperature')))
    .withFeature(exposes.composite('Intermediate 1', 'intermediate1')
        .withFeature(exposes.numeric('Hour', ea.STATE_SET).withProperty('hour'))
        .withFeature(exposes.numeric('Minute', ea.STATE_SET).withProperty('minute'))
        .withFeature(exposes.numeric('Temperature', ea.STATE_SET).withProperty('temperature')))
    .withFeature(exposes.composite('Intermediate 2', 'intermediate2')
        .withFeature(exposes.numeric('Hour', ea.STATE_SET).withProperty('hour'))
        .withFeature(exposes.numeric('Minute', ea.STATE_SET).withProperty('minute'))
        .withFeature(exposes.numeric('Temperature', ea.STATE_SET).withProperty('temperature')))
    .withFeature(exposes.composite('End', 'end')
        .withFeature(exposes.numeric('Hour', ea.STATE_SET).withProperty('hour'))
        .withFeature(exposes.numeric('Minute', ea.STATE_SET).withProperty('minute'))
        .withFeature(exposes.numeric('Temperature', ea.STATE_SET).withProperty('temperature')))
    .withDescription('Smart schedule configuration'),
  • Example:

image

@nurikk nurikk merged commit 51f9f80 into dev Jan 13, 2023
@Koenkk Koenkk deleted the composite branch January 13, 2023 16:14
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