mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 16:27:19 +00:00
Minor wording and puncutation changes (#22236)
This commit is contained in:
parent
c15560d458
commit
fb080425d0
@ -14,12 +14,12 @@ ha_platforms:
|
||||
- binary_sensor
|
||||
---
|
||||
|
||||
The `workday` binary sensor indicates, whether the current day is a workday or not. It allows specifying, which days of the week will count as workdays and also
|
||||
The `workday` binary sensor indicates whether the current day is a workday or not. It allows specifying which days of the week will count as workdays and also
|
||||
uses the Python module [holidays](https://pypi.python.org/pypi/holidays) to incorporate information about region-specific public holidays.
|
||||
|
||||
## Setup
|
||||
|
||||
Check the [country list](https://github.com/dr-prodigy/python-holidays#available-countries) for available province.
|
||||
Check the [country list](https://github.com/dr-prodigy/python-holidays#available-countries) for available provinces (and other subdivisions, like states and territories) for each country.
|
||||
|
||||
## Configuration
|
||||
To enable the `workday` sensor in your installation, add the following to your `configuration.yaml` file:
|
||||
@ -81,13 +81,13 @@ Otherwise, the value is evaluated as `false`.
|
||||
If you use the sensor for Canada (`CA`) with Ontario (`ON`) as `province:` then you need to wrap `ON` in quotes.
|
||||
Otherwise, the value is evaluated as `true` (check the YAML documentation for further details) and the sensor will not work.
|
||||
|
||||
One other thing to watch is how the `holiday` keyword is used. Your first instinct might be to add it to the `exclude` configuration, thinking that it means to skip the holidays. Actually it means to exclude the days in the holidays’ list from the workdays. So when you exclude `holiday` and a workday falls on that day, then that workday is excluded. Meaning the sensor will be off. If you want the workday flagged without regarding holidays, make sure that there is something in your `Excludes` configuration other than `holiday`.
|
||||
One other thing to watch is how the `holiday` keyword is used. Your first instinct might be to add it to the `exclude` configuration, thinking that it means to skip the holidays. Actually it means to exclude the days in the holidays list from the workdays. So, when you exclude `holiday` and a workday falls on that day, then that workday is excluded, and the sensor will be **off**. If you want every workday flagged with no regard to holidays, make sure that there is something in your `Excludes` configuration _other_ than `holiday`.
|
||||
|
||||
</div>
|
||||
|
||||
## Full examples
|
||||
|
||||
This example excludes Saturdays and Sundays but not holidays. Two custom holidays are added.
|
||||
This example excludes Saturdays and Sundays but not pre-configured holidays. Two custom holidays are added.
|
||||
|
||||
```yaml
|
||||
# Example 1 configuration.yaml entry
|
||||
@ -102,7 +102,7 @@ binary_sensor:
|
||||
```
|
||||
|
||||
This example excludes Saturdays, Sundays and holidays. One custom holiday is added.
|
||||
The date February 24th, 2020 is a Monday but will be excluded because it was added to the `add_holidays` configuration.
|
||||
The date February 24th, 2020 is a Monday, but will be excluded (the sensor will be **off**) because it was added to the `add_holidays` configuration.
|
||||
|
||||
```yaml
|
||||
# Example 2 configuration.yaml entry
|
||||
|
Loading…
x
Reference in New Issue
Block a user