esphome / home-assistant-voice-pe

Home Assistant Voice PE
Other
72 stars 10 forks source link

Add `audio_dac` component and `aic3204` platform #59

Closed kbx81 closed 2 months ago

kbx81 commented 2 months ago

Example usage:

audio_dac:
  - platform: aic3204

# mute buttons
button:
  - platform: template
    id: aic3204_mute_off
    name: AIC3204 Mute Off
    on_press:
      then:
        - audio_dac.mute_off:
  - platform: template
    id: aic3204_mute_on
    name: AIC3204 Mute On
    on_press:
      then:
        - audio_dac.mute_on:

# number components to change volume/auto-mute control
number:
  - platform: template
    id: aic3204_volume
    name: AIC3204 Volume
    entity_category: config
    mode: box
    unit_of_measurement: dB
    optimistic: true
    min_value: -63.5
    max_value: 24
    step: 0.5
    initial_value: 0
    restore_value: true
    on_value:
      then:
        - audio_dac.set_volume: !lambda "return x;"
  - platform: template
    id: aic3204_auto_mute
    name: AIC3204 Auto Mute Mode
    entity_category: config
    mode: box
    optimistic: true
    min_value: 0
    max_value: 7
    step: 1
    initial_value: 0
    restore_value: true
    on_value:
      then:
        - aic3204.set_auto_mute_mode: !lambda "return x;"
esphome[bot] commented 2 months ago

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:

Learn more about our pull request process.