bruxy70 / Holidays

📅 Custom Home Assistant integration for public holidays - also used for garbage_collection integration to automatically move scheduled events that fall on a public holiday (by an automation blueprint)
MIT License
45 stars 12 forks source link

(Public Holiday Calendar) Holiday not removed Error #36

Closed Scoff123 closed 2 years ago

Scoff123 commented 2 years ago

Before you submit a new bug report, please check that

Describe the bug

New error appeared this evening in Home Assistant Core logs. Upon clearing the error and restarting Home Assistant, the same error with an updated timestamp occurs.

Configuration

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.6.4",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.9.12",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/London",
    "os_name": "Linux",
    "os_version": "5.15.41",
    "supervisor": "2022.05.3",
    "host_os": "Home Assistant OS 8.1",
    "docker_version": "20.10.14",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "hildebrandglow_dcc": {
      "version": "0.6.0",
      "requirements": []
    },
    "garbage_collection": {
      "version": "4.7.8",
      "requirements": [
        "python-dateutil>=2.8.2"
      ]
    },
    "multiscrape": {
      "version": "6.3.1",
      "requirements": [
        "lxml",
        "beautifulsoup4==4.10.0"
      ]
    },
    "hacs": {
      "version": "1.25.5",
      "requirements": [
        "aiogithubapi>=22.2.4"
      ]
    },
    "sun2": {
      "version": "2.1.0",
      "requirements": []
    },
    "holidays": {
      "version": "1.7.4",
      "requirements": [
        "python-dateutil>=2.8.2",
        "holidays>=0.13"
      ]
    }
  },
  "integration_manifest": {
    "domain": "holidays",
    "name": "Holidays",
    "version": "1.7.4",
    "documentation": "https://github.com/bruxy70/Holidays/",
    "issue_tracker": "https://github.com/bruxy70/Holidays/issues",
    "iot_class": "calculated",
    "dependencies": [],
    "config_flow": true,
    "codeowners": [
      "@bruxy70"
    ],
    "requirements": [
      "python-dateutil>=2.8.2",
      "holidays>=0.13"
    ],
    "is_built_in": false
  },
  "data": {
    "entity_id": "calendar.public_holiday_calendar",
    "state": 82,
    "attributes": {
      "next_date": "2022-08-29T00:00:00+01:00",
      "next_holiday": "Late Summer Bank Holiday [England/Wales/Northern Ireland]",
      "last_updated": "2022-06-08T22:01:15.385676+01:00",
      "holidays": {
        "2021-01-01": "New Year's Day",
        "2021-04-02": "Good Friday",
        "2021-04-05": "Easter Monday [England/Wales/Northern Ireland]",
        "2021-05-03": "May Day",
        "2021-05-31": "Spring Bank Holiday",
        "2021-08-30": "Late Summer Bank Holiday [England/Wales/Northern Ireland]",
        "2021-12-25": "Christmas Day",
        "2021-12-26": "Boxing Day",
        "2021-12-27": "Christmas Day (Observed)",
        "2021-12-28": "Boxing Day (Observed)",
        "2022-01-01": "New Year's Day",
        "2022-01-03": "New Year's Day (Observed)",
        "2022-04-15": "Good Friday",
        "2022-04-18": "Easter Monday [England/Wales/Northern Ireland]",
        "2022-05-02": "May Day",
        "2022-06-02": "Spring Bank Holiday",
        "2022-06-03": "Platinum Jubilee of Elizabeth II",
        "2022-08-29": "Late Summer Bank Holiday [England/Wales/Northern Ireland]",
        "2022-12-25": "Christmas Day",
        "2022-12-26": "Boxing Day",
        "2022-12-27": "Christmas Day (Observed)",
        "2023-01-01": "New Year's Day",
        "2023-04-07": "Good Friday",
        "2023-04-10": "Easter Monday [England/Wales/Northern Ireland]",
        "2023-05-01": "May Day",
        "2023-05-29": "Spring Bank Holiday",
        "2023-08-28": "Late Summer Bank Holiday [England/Wales/Northern Ireland]",
        "2023-12-25": "Christmas Day",
        "2023-12-26": "Boxing Day"
      }
    },
    "config_entry": {
      "entry_id": "21a6a3d1486f39e726a1c8f219165c14",
      "version": 2,
      "domain": "holidays",
      "title": "Public Holiday Calendar",
      "data": {
        "unique_id": "af7653e8-0788-4185-a742-0b388cf8db17",
        "icon_normal": "mdi:calendar-blank",
        "icon_today": "mdi:calendar-arrow-right",
        "icon_tomorrow": "mdi:calendar-check",
        "country": "GB",
        "observed": true,
        "subdiv": "UK",
        "holiday_pop_named": [
          "Battle of the Boyne [Northern Ireland]",
          "New Year Holiday [Scotland]",
          "St. Andrew's Day [Scotland]",
          "St. Patrick's Day [Northern Ireland]",
          "New Year Holiday [Scotland] (Observed)",
          "Summer Bank Holiday [Scotland]"
        ]
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": null,
      "disabled_by": null
    }
  }
}

Debug logs

This error originated from a custom integration.

Logger: custom_components.holidays.calendar
Source: custom_components/holidays/calendar.py:111
Integration: Holidays (documentation, issues)
First occurred: 22:01:15 (1 occurrences)
Last logged: 22:01:15

(Public Holiday Calendar) Holiday not removed ('New Year Holiday [Scotland] (Observed)')
bruxy70 commented 2 years ago

It tries to remove holiday named New Year Holiday [Scotland] (Observed), but such holiday does not exist apparently (looking at the list of detected holidays. Looks like there was an update of the holidays library (they were fixing Ireland as a standalone country). So that maybe broke that. Try re-opening the integration configuration and check the parameters.

Scoff123 commented 2 years ago

I've reopened the Integration config and that holiday is still included in the list of holidays that you can choose to ignore, and is still checked from where I set up the integration initially

image

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had any activity in last 30 days. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

Scoff123 commented 2 years ago

This error is still frequently generating in HA core log

bruxy70 commented 2 years ago

Please test the latest beta version. And after you load it and restart, go to the configuration and click through the config. It should not show the observed holiday in the list of holidays anymore. You cannot remove an observed holiday, by removing the actual holiday, it will remove the observed date (just a passed functionality of the core module). So I removed the observed entries from the pop list.

Scoff123 commented 2 years ago

Thanks, sorry I can't see where to obtain the beta version - can you provide a link please? I'm using 1.7.4 currently.

bruxy70 commented 2 years ago

In your HACS, click on the ..., redownload, and check allow beta. Or you can wait for the release. In fact, you can just uncheck the observed holiday, that should get rid of the errors

Scoff123 commented 2 years ago

Great will do, thanks for your help 👍