Workday check_date service (#28344)

* Workday check_date service

* Mod output

* Remove date from response
This commit is contained in:
G Johansson 2023-11-22 08:03:45 +01:00 committed by GitHub
parent ca9157cb90
commit d2acff2525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: