diff --git a/uptime_kuma_api/api.py b/uptime_kuma_api/api.py index 28d8214..11a6571 100644 --- a/uptime_kuma_api/api.py +++ b/uptime_kuma_api/api.py @@ -5,7 +5,7 @@ import string import time from contextlib import contextmanager from copy import deepcopy -from typing import Any, Union +from typing import Any import requests import socketio @@ -181,10 +181,10 @@ def _build_maintenance_data( strategy: MaintenanceStrategy, active: bool = True, description: str = "", - dateRange: list[str] = None, + dateRange: list = None, intervalDay: int = 1, - weekdays: list[int] = None, - daysOfMonth: list[Union[int, str]] = None, + weekdays: list = None, + daysOfMonth: list = None, timeRange: list = None ) -> dict: if not dateRange: diff --git a/uptime_kuma_api/docstrings.py b/uptime_kuma_api/docstrings.py index c91cd7a..ae22a76 100644 --- a/uptime_kuma_api/docstrings.py +++ b/uptime_kuma_api/docstrings.py @@ -242,9 +242,9 @@ def maintenance_docstring(mode) -> str: :param MaintenanceStrategy{", optional" if mode == "edit" else ""} strategy: Strategy :param bool, optional active: True if maintenance is active, defaults to ``True`` :param str, optional description: Description, defaults to ``""`` - :param list[str], optional dateRange: DateTime Range, defaults to ``[""]`` + :param list, optional dateRange: DateTime Range, defaults to ``[""]`` :param int, optional intervalDay: Interval (Run once every day), defaults to ``1`` - :param list[int], optional weekdays: List that contains the days of the week on which the maintenance is enabled (Sun = ``0``, Mon = ``1``, ..., Sat = ``6``). Required for ``strategy`` :attr:`~.MaintenanceStrategy.RECURRING_WEEKDAY`., defaults to ``[]``. - :param list[Union[int, str]], optional daysOfMonth: List that contains the days of the month on which the maintenance is enabled (Day 1 = ``1``, Day 2 = ``2``, ..., Day 31 = ``31``) and the last day of the month (Last Day of Month = ``"lastDay1"``, 2nd Last Day of Month = ``"lastDay2"``, 3rd Last Day of Month = ``"lastDay3"``, 4th Last Day of Month = ``"lastDay4"``). Required for ``strategy`` :attr:`~.MaintenanceStrategy.RECURRING_DAY_OF_MONTH`., defaults to ``[]``. + :param list, optional weekdays: List that contains the days of the week on which the maintenance is enabled (Sun = ``0``, Mon = ``1``, ..., Sat = ``6``). Required for ``strategy`` :attr:`~.MaintenanceStrategy.RECURRING_WEEKDAY`., defaults to ``[]``. + :param list, optional daysOfMonth: List that contains the days of the month on which the maintenance is enabled (Day 1 = ``1``, Day 2 = ``2``, ..., Day 31 = ``31``) and the last day of the month (Last Day of Month = ``"lastDay1"``, 2nd Last Day of Month = ``"lastDay2"``, 3rd Last Day of Month = ``"lastDay3"``, 4th Last Day of Month = ``"lastDay4"``). Required for ``strategy`` :attr:`~.MaintenanceStrategy.RECURRING_DAY_OF_MONTH`., defaults to ``[]``. :param list, optional timeRange: Maintenance Time Window of a Day, defaults to ``[{{"hours": 2, "minutes": 0}}, {{"hours": 3, "minutes": 0}}]``. """