Workday sensor, extra working days

Currently workday sensor supports workdays/holidays for most of the cases.
Unfortunately I havent found a way to add “extra” workdays to its list, either by date, or by name.
Not sure how it happens in other countries, but in my country sometimes they move a workday to weekends, so another time it can be “merged together” to have a longer weekend.
ie.: 2022-03-26 (Saturday) counts as a workday.

Is there any way to do it, or any plan to extend it? Or should it be asked on from holidays · PyPI instead?

Relevant integration: Workday - Home Assistant

You mean, with the options to add or remove holidays?

https://www.home-assistant.io/integrations/workday/#add_holidays
https://www.home-assistant.io/integrations/workday/#remove_holidays

By doing exactly the opposite of holidays, or just defining custom list of special days, so something like this:

binary_sensor:
  - platform: workday
    country: US
    workdays: [mon, tue, wed, thu, fri, extra_workdays]
    excludes: [sat, sun, holidays]
    add_holidays:
      - "2020-02-24"
      - "2020-04-25"
    add_extra_workdays:
      - "2022-02-26" # Saturday

Current implementation just “demotes” a holiday to a regular day, but can not “promote” a weekend to a weekday. (ofc you can put holidays to weekdays, but that doesnt solve anything)

Remove holidays (treat holiday as workday)

Days are either a workday, or a non-working day… it’s purely binary.

If you remove 2022-02-26 as a holiday, it becomes a workday.

kinda. you have a whitelist, and a blacklist.
on overlap, blacklist wins.
so if its both Monday and holiday, it will be non-workday.
but right now you can’t say its Saturday and extra-workday to make it a workday.
My point is with 02-26 is that’s a weekend, so config from above would consider it as non-workday, since it’s in the exclude list

1 Like