Skip to content

Commit ead5c7c

Browse files
committed
Add documentation for input number create and delete actions
1 parent 440c42a commit ead5c7c

3 files changed

Lines changed: 132 additions & 2 deletions

File tree

92.5 KB
Loading
85.4 KB
Loading

documentation/integrations/input_number.md

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ subject: Enhanced integrations
33
title: Input number
44
subtitle: Give me your digits. 🔢
55
thumbnail: ../images/integrations/input_number/example.png
6-
description: Spook adds some new actions to the input number integration, which allows you to set the value to the minimum or maximum value, or increase or decrease value by a given amount.
6+
description: Spook adds some new actions to the input number integration, which allows you to create and delete input number helpers on the fly, set the value to the minimum or maximum value, or increase or decrease value by a given amount.
77
date: 2023-08-09T21:29:00+02:00
88
---
99

@@ -17,7 +17,7 @@ date: 2023-08-09T21:29:00+02:00
1717

1818
The input number {term}`helper` in {term}`Home Assistant` allows the user to define values that can be controlled via the frontend and can be used within conditions of an {term}`automation <automation>`. The frontend can display a slider or a numeric input box. Changes to the slider or numeric input box generate state events. These state events can be utilized as automation triggers as well.
1919

20-
Spook adds some new actions to the input number {term}`integration <integration>`, which allows you to set the value to the minimum or maximum value, and enhances the existing increase and decrease actions by allowing them to increase/decrease the value by a given amount.
20+
Spook adds some new actions to the input number {term}`integration <integration>`, which allows you to create and delete input number helpers on the fly, set the value to the minimum or maximum value, and enhances the existing increase and decrease actions by allowing them to increase/decrease the value by a given amount.
2121

2222
```{figure} ../images/integrations/input_number/example.png
2323
:name: example
@@ -35,6 +35,134 @@ Spook does not provide any new devices or entities for this integration.
3535

3636
Spook adds the following new actions to your Home Assistant instance:
3737

38+
### Create an input number
39+
40+
```{figure} ../images/integrations/input_number/create.png
41+
:alt: Screenshot of the input number create action in the developer tools.
42+
:align: center
43+
```
44+
45+
```{list-table}
46+
:header-rows: 1
47+
* - Action properties
48+
* - {term}`Action`
49+
- Input number: Create an input number 👻
50+
* - {term}`Action name`
51+
- `input_number.create`
52+
* - {term}`Action targets`
53+
- No targets
54+
* - {term}`Action response`
55+
- No response
56+
* - {term}`Spook's influence <influence of spook>`
57+
- Newly added action
58+
* - {term}`Developer tools`
59+
- [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_number.create)
60+
[![Open your Home Assistant instance and show your actions developer tools with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=input_number.create)
61+
```
62+
63+
```{list-table}
64+
:header-rows: 2
65+
* - Action data parameters
66+
* - Attribute
67+
- Type
68+
- Required
69+
- Default / Example
70+
* - `name`
71+
- {term}`string <string>`
72+
- Yes
73+
- `My input number`
74+
* - `input_number_id`
75+
- {term}`string <string>`
76+
- No
77+
- `my_input_number`
78+
* - `min`
79+
- {term}`float <float>`
80+
- No
81+
- `0`
82+
* - `max`
83+
- {term}`float <float>`
84+
- No
85+
- `100`
86+
* - `initial`
87+
- {term}`float <float>`
88+
- No
89+
- `50`
90+
* - `step`
91+
- {term}`float <float>`
92+
- No
93+
- `1`
94+
* - `mode`
95+
- {term}`string <string>`
96+
- No
97+
- `slider`
98+
* - `icon`
99+
- {term}`string <string>`
100+
- No
101+
- `mdi:counter`
102+
* - `unit_of_measurement`
103+
- {term}`string <string>`
104+
- No
105+
- `°C`
106+
```
107+
108+
:::{seealso} Example {term}`action <performing actions>` in {term}`YAML`
109+
:class: dropdown
110+
111+
```{code-block} yaml
112+
:linenos:
113+
action: input_number.create
114+
data:
115+
name: "My counter"
116+
input_number_id: my_counter
117+
min: 0
118+
max: 100
119+
step: 1
120+
mode: slider
121+
```
122+
123+
:::
124+
125+
### Delete an input number
126+
127+
:::{note}
128+
Input number helpers that are created and managed using manual YAML configuration cannot be deleted.
129+
:::
130+
131+
```{figure} ../images/integrations/input_number/delete.png
132+
:alt: Screenshot of the input number delete action in the developer tools.
133+
:align: center
134+
```
135+
136+
```{list-table}
137+
:header-rows: 1
138+
* - Action properties
139+
* - {term}`Action`
140+
- Input number: Delete an input number 👻
141+
* - {term}`Action name`
142+
- `input_number.delete`
143+
* - {term}`Action targets`
144+
- Yes, `input_number` entities
145+
* - {term}`Action response`
146+
- No response
147+
* - {term}`Spook's influence <influence of spook>`
148+
- Newly added action
149+
* - {term}`Developer tools`
150+
- [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_number.delete)
151+
[![Open your Home Assistant instance and show your actions developer tools with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=input_number.delete)
152+
```
153+
154+
:::{seealso} Example {term}`action <performing actions>` in {term}`YAML`
155+
:class: dropdown
156+
157+
```{code-block} yaml
158+
:linenos:
159+
action: input_number.delete
160+
target:
161+
entity_id: input_number.my_counter
162+
```
163+
164+
:::
165+
38166
### Decrease value
39167

40168
Decrease an input number entity value by a certain amount.
@@ -233,6 +361,8 @@ Spook has no repair detections for this integration.
233361

234362
Some use cases for the enhancements Spook provides for this integration:
235363

364+
- Dynamically create input number helpers from a blueprint or script, without requiring the user to set them up manually beforehand.
365+
- Clean up temporary input number helpers created by an automation or script when they are no longer needed.
236366
- Quickly, with a single action, set the value of an input helper to its maximum or minimum value.
237367
- Instead of having to call the `input_number.decrement` or `input_number.increment` action multiple times, you can now set the amount to increase or decrease the value with.
238368

0 commit comments

Comments
 (0)