mirror of
https://github.com/esphome/esphome.git
synced 2026-10-21 13:34:12 +00:00
28 lines
604 B
YAML
28 lines
604 B
YAML
fusb302b:
|
|
id: pd
|
|
interrupt_pin: ${interrupt_pin}
|
|
request_voltage: 20
|
|
contract:
|
|
name: PD Contract
|
|
voltage:
|
|
name: PD Voltage
|
|
current:
|
|
name: PD Current
|
|
on_connect:
|
|
- logger.log: "Source attached"
|
|
on_disconnect:
|
|
- logger.log: "Source removed"
|
|
on_power_ready:
|
|
- if:
|
|
condition:
|
|
fusb302b.is_connected: pd
|
|
then:
|
|
- logger.log: "Power ready"
|
|
on_request_failed:
|
|
- logger.log: "Voltage request failed"
|
|
on_error:
|
|
- fusb302b.request_voltage: 5
|
|
- fusb302b.request_voltage:
|
|
id: pd
|
|
voltage: !lambda "return 9;"
|