Number
The more-info view of a number entity of a device, a slider or a number field in the state row.
Number entities are the settings of a device that take a number, like the bass of a speaker or the sensitivity of a motion sensor. Like the input number helper, they don't have the newer more-info design. The control lives in the state row at the top of the dialog: the icon and name on the left, the control on the right.
The integration picks the mode of the number:
- Slider: a slider, with the value next to it. The bass of the living room speaker above goes from -10 to 10, as a slider.
- Box: a number text input, with the unit at the end.
- Auto: a slider when the range has a limited number of steps, and a field when it has too many to pick from with a slider.
Below the state row, the dialog shows the history of the entity and its activity. The demo shows only the state row.
- The slider and the field use the minimum, maximum, and step the device reports.
- The new value is sent when you let go of the slider, or when you confirm the field.
- When the entity is unavailable, the slider and the field are disabled.
The state row is state-card-number in src/state-summary/state-card-number.ts. Whether it shows a slider is decided by showNumberSlider in src/data/number.ts. There is no more-info-number: the domain is in DOMAINS_HIDE_DEFAULT_MORE_INFO in src/dialogs/more-info/const.ts.
Source: state-card-number.ts