I am wondering if there is an alternative to the individual definitions of ports like this one:
# Example configuration entry
sn74hc165:
- id: sn74hc165_hub
clock_pin: GPIO16
data_pin: GPIO17
load_pin: GPIO4
clock_inhibit_pin: GPIO18
sr_count: 2
# Individual inputs
binary_sensor:
- platform: gpio
name: "SN74HC165 Pin #0"
pin:
sn74hc165: sn74hc165_hub
# Use pin number 0
number: 0
inverted: false
- platform: gpio
name: "SN74HC165 Pin #1"
pin:
sn74hc165: sn74hc165_hub
# Use pin number 1
number: 1
inverted: false
This copy&paste definition gets old pretty quickly. Envision deploying the maximum of 256 Shift registers * 8 ports.
Would it be an option to define this in a for loop i.e. in a lambda?