I am trying to learn HA in more details, hopefully being able to contribute to the source code one day. Now spending more time to learn YAML for the configuration purposes.
What I came across is that it seems HA uses 2 different mods of defining some types. For example, input_number helper is defined as set of dictionaries
# Example configuration.yaml entry
input_number:
slider1: //One slide
name: Slider
initial: 30
min: -20
max: 35
step: 1
box1: //Second slider
name: Numeric Input Box
initial: 30
min: -20
max: 35
step: 1
mode: box
While for example a new min_max sensor is defined as an array of sensors:
# Example configuration.yaml entry
sensor:
//Defined as list entry, without key
- platform: min_max //This is sensor 1
entity_ids:
- sensor.kitchen_temperature
- sensor.living_room_temperature
- sensor.office_temperature
Therefore why isn't input_number also defined as:
input_number:
// Slider 1
- name: Slider
initial: 30
min: -20
max: 35
step: 1
// Number 2
- name: Numeric Input Box
initial: 30
min: -20
max: 35
step: 1
mode: box
Or sensorlike this:
# Example configuration.yaml entry
sensor:
//Defined as list entry, without key
sensor1:
platform: min_max //This is sensor 1
entity_ids:
- sensor.kitchen_temperature
- sensor.living_room_temperature
- sensor.office_temperature
Why are there 2 different ways of defining objects?