mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-13 12:26:50 +00:00
Workday check_date service (#28344)
* Workday check_date service * Mod output * Remove date from response
This commit is contained in:
parent
ca9157cb90
commit
d2acff2525
@ -50,6 +50,32 @@ Remove holidays will take dates formatted with `YYYY-MM-DD`, a date range format
|
||||
|
||||
The offset can be used to see if future days are workdays. For example, put `1` to see if tomorrow is a workday.
|
||||
|
||||
## Service `workday.check_date`
|
||||
|
||||
This service populates [Response Data](/docs/scripts/service-calls#use-templates-to-handle-response-data)
|
||||
providing feedback if the date is a workday or not.
|
||||
|
||||
| Service data attribute | Required | Description | Example |
|
||||
| ---------------------- | -------- | ----------- | --------|
|
||||
| `check_date` | yes | Date to test if workday or not. | 2022-03-10
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
service: workday.check_date
|
||||
target:
|
||||
entity_id: binary_sensor.workday
|
||||
data:
|
||||
check_date: "2023-12-25"
|
||||
response_variable: check_date
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
The response data field `check_date` is providing:
|
||||
|
||||
| Response data | Description | Example |
|
||||
| ---------------------- | ----------- | -------- |
|
||||
| `workday` | Is date a workday. | True
|
||||
|
||||
## Automation example
|
||||
|
||||
Example usage for automation:
|
||||
|
Loading…
x
Reference in New Issue
Block a user