Add counter.set_value service (#27345)

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
Franck Nijhof 2023-05-10 18:52:20 +02:00 committed by GitHub
parent aac977cb5f
commit 089f3c794e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ ha_domain: counter
ha_integration_type: helper ha_integration_type: helper
--- ---
The `counter` integration allows one to count occurrences fired by automations. The Counter integration allows one to count occurrences fired by automations.
## Configuration ## Configuration
@ -85,7 +85,7 @@ If `restore` is set to `true`, the `initial` value will only be used when no pre
## Services ## Services
Available services: `increment`, `decrement`, `reset` and `configure`. Available services: `increment`, `decrement`, `reset`, `set_value` and `configure`.
### Service `counter.increment` ### Service `counter.increment`
@ -111,6 +111,15 @@ With this service the counter is reset to its initial value.
| ---------------------- | -------- | ----------- | | ---------------------- | -------- | ----------- |
| `entity_id` | no | Name of the entity to take action, e.g., `counter.my_custom_counter`. | | `entity_id` | no | Name of the entity to take action, e.g., `counter.my_custom_counter`. |
### Service `counter.set_value`
This service allows setting the counter to a specific value.
| Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- |
| `entity_id` | no | Name of the entity to take action, e.g., `counter.my_custom_counter`. |
| `value` | yes | Set the counter to the given value. |
### Service `counter.configure` ### Service `counter.configure`
With this service the properties of the counter can be changed while running. With this service the properties of the counter can be changed while running.