Functions | |
| rrule | build_rrule (dict[str, Any] task) |
| list[str] | entity_used_in (HomeAssistant hass, str entity_id) |
| dict[str, float] | get_attribute_points (dict[str, Any] user, dict[str, Any] content, str attribute) |
| int | get_attributes_total (dict[str, Any] user, dict[str, Any] content, str attribute) |
| str | get_recurrence_rule (rrule recurrence) |
| datetime.date|None | next_due_date (dict[str, Any] task, str last_cron) |
| datetime.date|None | to_date (str date) |
Variables | |
| dictionary | FREQUENCY_MAP = {"daily": DAILY, "weekly": WEEKLY, "monthly": MONTHLY, "yearly": YEARLY} |
| dictionary | WEEKDAY_MAP = {"m": MO, "t": TU, "w": WE, "th": TH, "f": FR, "s": SA, "su": SU} |
Utility functions for Habitica.
| rrule homeassistant.components.habitica.util.build_rrule | ( | dict[str, Any] | task | ) |
| list[str] homeassistant.components.habitica.util.entity_used_in | ( | HomeAssistant | hass, |
| str | entity_id | ||
| ) |
| dict[str, float] homeassistant.components.habitica.util.get_attribute_points | ( | dict[str, Any] | user, |
| dict[str, Any] | content, | ||
| str | attribute | ||
| ) |
| int homeassistant.components.habitica.util.get_attributes_total | ( | dict[str, Any] | user, |
| dict[str, Any] | content, | ||
| str | attribute | ||
| ) |
| str homeassistant.components.habitica.util.get_recurrence_rule | ( | rrule | recurrence | ) |
Extract and return the recurrence rule portion of an RRULE.
This function takes an RRULE representing a task's recurrence pattern,
builds the RRULE string, and extracts the recurrence rule part.
'DTSTART:YYYYMMDDTHHMMSS\nRRULE:FREQ=YEARLY;INTERVAL=2'
Parameters
----------
recurrence : rrule
An RRULE object.
Returns
-------
str
The recurrence rule portion of the RRULE string, starting with 'FREQ='.
Example
-------
>>> rule = get_recurrence_rule(task)
>>> print(rule)
'FREQ=YEARLY;INTERVAL=2'
| datetime.date | None homeassistant.components.habitica.util.next_due_date | ( | dict[str, Any] | task, |
| str | last_cron | ||
| ) |
| datetime.date | None homeassistant.components.habitica.util.to_date | ( | str | date | ) |
| dictionary homeassistant.components.habitica.util.FREQUENCY_MAP = {"daily": DAILY, "weekly": WEEKLY, "monthly": MONTHLY, "yearly": YEARLY} |