mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Migrate calendar entity attributes to StrEnum (#174615)
This commit is contained in:
@@ -68,6 +68,7 @@ from .const import (
|
||||
EVENT_UID,
|
||||
LIST_EVENT_FIELDS,
|
||||
CalendarEntityFeature,
|
||||
CalendarEntityStateAttribute,
|
||||
)
|
||||
|
||||
# mypy: disallow-any-generics
|
||||
@@ -519,7 +520,9 @@ class CalendarEntity(Entity):
|
||||
|
||||
entity_description: CalendarEntityDescription
|
||||
|
||||
_entity_component_unrecorded_attributes = frozenset({"description"})
|
||||
_entity_component_unrecorded_attributes = frozenset(
|
||||
{CalendarEntityStateAttribute.DESCRIPTION}
|
||||
)
|
||||
|
||||
_alarm_unsubs: list[CALLBACK_TYPE] | None = None
|
||||
_event_listeners: (
|
||||
@@ -573,12 +576,16 @@ class CalendarEntity(Entity):
|
||||
return None
|
||||
|
||||
return {
|
||||
"message": event.summary,
|
||||
"all_day": event.all_day,
|
||||
"start_time": event.start_datetime_local.strftime(DATE_STR_FORMAT),
|
||||
"end_time": event.end_datetime_local.strftime(DATE_STR_FORMAT),
|
||||
"location": event.location or "",
|
||||
"description": event.description or "",
|
||||
CalendarEntityStateAttribute.MESSAGE: event.summary,
|
||||
CalendarEntityStateAttribute.ALL_DAY: event.all_day,
|
||||
CalendarEntityStateAttribute.START_TIME: event.start_datetime_local.strftime(
|
||||
DATE_STR_FORMAT
|
||||
),
|
||||
CalendarEntityStateAttribute.END_TIME: event.end_datetime_local.strftime(
|
||||
DATE_STR_FORMAT
|
||||
),
|
||||
CalendarEntityStateAttribute.LOCATION: event.location or "",
|
||||
CalendarEntityStateAttribute.DESCRIPTION: event.description or "",
|
||||
}
|
||||
|
||||
@final
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Constants for calendar components."""
|
||||
|
||||
from enum import IntFlag
|
||||
from enum import IntFlag, StrEnum
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from homeassistant.util.hass_dict import HassKey
|
||||
@@ -14,6 +14,17 @@ DOMAIN = "calendar"
|
||||
DATA_COMPONENT: HassKey[EntityComponent[CalendarEntity]] = HassKey(DOMAIN)
|
||||
|
||||
|
||||
class CalendarEntityStateAttribute(StrEnum):
|
||||
"""State attributes for calendar entities."""
|
||||
|
||||
MESSAGE = "message"
|
||||
ALL_DAY = "all_day"
|
||||
START_TIME = "start_time"
|
||||
END_TIME = "end_time"
|
||||
LOCATION = "location"
|
||||
DESCRIPTION = "description"
|
||||
|
||||
|
||||
class CalendarEntityFeature(IntFlag):
|
||||
"""Supported features of the calendar entity."""
|
||||
|
||||
|
||||
@@ -967,13 +967,13 @@
|
||||
# name: test_calendar_platform[calendar.test_user_dailies-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'Klicke um Deinen Terminplan festzulegen!',
|
||||
'end_time': '2024-09-22 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Klicke um Deinen Terminplan festzulegen!',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-09-22 00:00:00',
|
||||
'friendly_name': 'test-user Dailies',
|
||||
'location': '',
|
||||
'message': '5 Minuten ruhig durchatmen',
|
||||
'start_time': '2024-09-21 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: '5 Minuten ruhig durchatmen',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-09-21 00:00:00',
|
||||
'yesterdaily': False,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@@ -1024,13 +1024,13 @@
|
||||
# name: test_calendar_platform[calendar.test_user_daily_reminders-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': 'Klicke um Deinen Terminplan festzulegen!',
|
||||
'end_time': '2024-09-21 21:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Klicke um Deinen Terminplan festzulegen!',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-09-21 21:00:00',
|
||||
'friendly_name': 'test-user Daily reminders',
|
||||
'location': '',
|
||||
'message': '5 Minuten ruhig durchatmen',
|
||||
'start_time': '2024-09-21 20:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: '5 Minuten ruhig durchatmen',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-09-21 20:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.test_user_daily_reminders',
|
||||
@@ -1080,13 +1080,13 @@
|
||||
# name: test_calendar_platform[calendar.test_user_to_do_reminders-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': 'Strom- und Internetrechnungen rechtzeitig überweisen.',
|
||||
'end_time': '2024-09-22 03:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Strom- und Internetrechnungen rechtzeitig überweisen.',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-09-22 03:00:00',
|
||||
'friendly_name': 'test-user To-do reminders',
|
||||
'location': '',
|
||||
'message': 'Rechnungen bezahlen',
|
||||
'start_time': '2024-09-22 02:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Rechnungen bezahlen',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-09-22 02:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.test_user_to_do_reminders',
|
||||
@@ -1136,13 +1136,13 @@
|
||||
# name: test_calendar_platform[calendar.test_user_to_do_s-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'Den Ausflug für das kommende Wochenende organisieren.',
|
||||
'end_time': '2024-09-22 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Den Ausflug für das kommende Wochenende organisieren.',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-09-22 00:00:00',
|
||||
'friendly_name': "test-user To-Do's",
|
||||
'location': '',
|
||||
'message': 'Wochenendausflug planen',
|
||||
'start_time': '2024-09-21 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Wochenendausflug planen',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-09-21 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.test_user_to_do_s',
|
||||
|
||||
@@ -105,13 +105,13 @@
|
||||
# name: test_entities[Jerusalem][calendar.jewish_calendar_daily_events-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': "Hebrew date: 5 Sh'vat 5784",
|
||||
'end_time': '2024-01-16 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: "Hebrew date: 5 Sh'vat 5784",
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-16 00:00:00',
|
||||
'friendly_name': 'Jewish Calendar Daily events',
|
||||
'location': '',
|
||||
'message': "5 Sh'vat 5784",
|
||||
'start_time': '2024-01-15 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: "5 Sh'vat 5784",
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-15 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.jewish_calendar_daily_events',
|
||||
@@ -161,13 +161,13 @@
|
||||
# name: test_entities[Jerusalem][calendar.jewish_calendar_learning_schedule-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'Daf Yomi: Bava Kamma 74',
|
||||
'end_time': '2024-01-16 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Daf Yomi: Bava Kamma 74',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-16 00:00:00',
|
||||
'friendly_name': 'Jewish Calendar Learning schedule',
|
||||
'location': '',
|
||||
'message': 'Bava Kamma 74',
|
||||
'start_time': '2024-01-15 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Bava Kamma 74',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-15 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.jewish_calendar_learning_schedule',
|
||||
@@ -217,13 +217,13 @@
|
||||
# name: test_entities[Jerusalem][calendar.jewish_calendar_yearly_events-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': 'Candle lighting time: 16:21',
|
||||
'end_time': '2024-01-19 16:21:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Candle lighting time: 16:21',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-19 16:21:00',
|
||||
'friendly_name': 'Jewish Calendar Yearly events',
|
||||
'location': '',
|
||||
'message': 'Candle Lighting',
|
||||
'start_time': '2024-01-19 16:21:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Candle Lighting',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-19 16:21:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.jewish_calendar_yearly_events',
|
||||
@@ -273,13 +273,13 @@
|
||||
# name: test_entities[New York][calendar.jewish_calendar_daily_events-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': "Hebrew date: 5 Sh'vat 5784",
|
||||
'end_time': '2024-01-16 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: "Hebrew date: 5 Sh'vat 5784",
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-16 00:00:00',
|
||||
'friendly_name': 'Jewish Calendar Daily events',
|
||||
'location': '',
|
||||
'message': "5 Sh'vat 5784",
|
||||
'start_time': '2024-01-15 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: "5 Sh'vat 5784",
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-15 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.jewish_calendar_daily_events',
|
||||
@@ -329,13 +329,13 @@
|
||||
# name: test_entities[New York][calendar.jewish_calendar_learning_schedule-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'Daf Yomi: Bava Kamma 74',
|
||||
'end_time': '2024-01-16 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Daf Yomi: Bava Kamma 74',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-16 00:00:00',
|
||||
'friendly_name': 'Jewish Calendar Learning schedule',
|
||||
'location': '',
|
||||
'message': 'Bava Kamma 74',
|
||||
'start_time': '2024-01-15 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Bava Kamma 74',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-15 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.jewish_calendar_learning_schedule',
|
||||
@@ -385,13 +385,13 @@
|
||||
# name: test_entities[New York][calendar.jewish_calendar_yearly_events-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': 'Candle lighting time: 16:39',
|
||||
'end_time': '2024-01-19 16:39:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Candle lighting time: 16:39',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-19 16:39:00',
|
||||
'friendly_name': 'Jewish Calendar Yearly events',
|
||||
'location': '',
|
||||
'message': 'Candle Lighting',
|
||||
'start_time': '2024-01-19 16:39:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Candle Lighting',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-19 16:39:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.jewish_calendar_yearly_events',
|
||||
|
||||
@@ -338,13 +338,13 @@
|
||||
# name: test_calendar_events[state.GS012345_auto_on_off_schedule_axfz5bj]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': 'Machine is scheduled to turn on at the start time and off at the end time',
|
||||
'end_time': '2024-01-14 07:30:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Machine is scheduled to turn on at the start time and off at the end time',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-14 07:30:00',
|
||||
'friendly_name': 'GS012345 Auto on/off schedule (aXFz5bJ)',
|
||||
'location': '',
|
||||
'message': 'Machine My LaMarzocco on',
|
||||
'start_time': '2024-01-14 07:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Machine My LaMarzocco on',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-14 07:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.gs012345_auto_on_off_schedule_axfz5bj',
|
||||
@@ -357,13 +357,13 @@
|
||||
# name: test_calendar_events[state.GS012345_auto_on_off_schedule_os2oswx]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': 'Machine is scheduled to turn on at the start time and off at the end time',
|
||||
'end_time': '2024-01-13 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Machine is scheduled to turn on at the start time and off at the end time',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-13 00:00:00',
|
||||
'friendly_name': 'GS012345 Auto on/off schedule (Os2OswX)',
|
||||
'location': '',
|
||||
'message': 'Machine My LaMarzocco on',
|
||||
'start_time': '2024-01-12 22:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Machine My LaMarzocco on',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-12 22:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.gs012345_auto_on_off_schedule_os2oswx',
|
||||
|
||||
@@ -173,13 +173,13 @@
|
||||
# name: test_entities[calendar.mealie_breakfast-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'The BEST Roast Chicken recipe is simple, budget friendly, and gives you a tender, mouth-watering chicken full of flavor! Served with roasted vegetables, this recipe is simple enough for any cook!',
|
||||
'end_time': '2024-01-24 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'The BEST Roast Chicken recipe is simple, budget friendly, and gives you a tender, mouth-watering chicken full of flavor! Served with roasted vegetables, this recipe is simple enough for any cook!',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-24 00:00:00',
|
||||
'friendly_name': 'Mealie Breakfast',
|
||||
'location': '',
|
||||
'message': 'Roast Chicken',
|
||||
'start_time': '2024-01-23 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Roast Chicken',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-23 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.mealie_breakfast',
|
||||
@@ -229,13 +229,13 @@
|
||||
# name: test_entities[calendar.mealie_dessert-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'Delicious Greek turkey meatballs with lemon orzo, tender veggies, and a creamy feta yogurt sauce. These healthy baked Greek turkey meatballs are filled with tons of wonderful herbs and make the perfect protein-packed weeknight meal!',
|
||||
'end_time': '2024-01-24 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Delicious Greek turkey meatballs with lemon orzo, tender veggies, and a creamy feta yogurt sauce. These healthy baked Greek turkey meatballs are filled with tons of wonderful herbs and make the perfect protein-packed weeknight meal!',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-24 00:00:00',
|
||||
'friendly_name': 'Mealie Dessert',
|
||||
'location': '',
|
||||
'message': 'Greek Turkey Meatballs with Lemon Orzo & Creamy Feta Yogurt Sauce',
|
||||
'start_time': '2024-01-23 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Greek Turkey Meatballs with Lemon Orzo & Creamy Feta Yogurt Sauce',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-23 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.mealie_dessert',
|
||||
@@ -285,13 +285,13 @@
|
||||
# name: test_entities[calendar.mealie_dinner-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'Dineren met de boys',
|
||||
'end_time': '2024-01-22 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Dineren met de boys',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-22 00:00:00',
|
||||
'friendly_name': 'Mealie Dinner',
|
||||
'location': '',
|
||||
'message': 'Aquavite',
|
||||
'start_time': '2024-01-21 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Aquavite',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-21 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.mealie_dinner',
|
||||
@@ -341,13 +341,13 @@
|
||||
# name: test_entities[calendar.mealie_drink-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'Einfacher Nudelauflauf mit Brokkoli, Sahnesauce und extra Käse. Dieses vegetarische 5 Zutaten Rezept ist super schnell gemacht und SO gut!',
|
||||
'end_time': '2024-01-23 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Einfacher Nudelauflauf mit Brokkoli, Sahnesauce und extra Käse. Dieses vegetarische 5 Zutaten Rezept ist super schnell gemacht und SO gut!',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-23 00:00:00',
|
||||
'friendly_name': 'Mealie Drink',
|
||||
'location': '',
|
||||
'message': 'Einfacher Nudelauflauf mit Brokkoli',
|
||||
'start_time': '2024-01-22 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Einfacher Nudelauflauf mit Brokkoli',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-22 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.mealie_drink',
|
||||
@@ -397,13 +397,13 @@
|
||||
# name: test_entities[calendar.mealie_lunch-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'This All-American beef stew recipe includes tender beef coated in a rich, intense sauce and vegetables that bring complementary texture and flavor.',
|
||||
'end_time': '2024-01-23 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'This All-American beef stew recipe includes tender beef coated in a rich, intense sauce and vegetables that bring complementary texture and flavor.',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-23 00:00:00',
|
||||
'friendly_name': 'Mealie Lunch',
|
||||
'location': '',
|
||||
'message': 'All-American Beef Stew Recipe',
|
||||
'start_time': '2024-01-22 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'All-American Beef Stew Recipe',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-22 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.mealie_lunch',
|
||||
@@ -453,13 +453,13 @@
|
||||
# name: test_entities[calendar.mealie_side-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'Einfacher Nudelauflauf mit Brokkoli, Sahnesauce und extra Käse. Dieses vegetarische 5 Zutaten Rezept ist super schnell gemacht und SO gut!',
|
||||
'end_time': '2024-01-24 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Einfacher Nudelauflauf mit Brokkoli, Sahnesauce und extra Käse. Dieses vegetarische 5 Zutaten Rezept ist super schnell gemacht und SO gut!',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-24 00:00:00',
|
||||
'friendly_name': 'Mealie Side',
|
||||
'location': '',
|
||||
'message': 'Einfacher Nudelauflauf mit Brokkoli',
|
||||
'start_time': '2024-01-23 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Einfacher Nudelauflauf mit Brokkoli',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-23 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.mealie_side',
|
||||
@@ -509,13 +509,13 @@
|
||||
# name: test_entities[calendar.mealie_snack-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': 'Avis aux nostalgiques des années 1980, la mousse de saumon est de retour dans une présentation adaptée au goût du jour. On utilise une technique sans faille : un saumon frais cuit au micro-ondes et mélangé au robot avec du fromage à la crème et de la crème sure. On obtient ainsi une texture onctueuse à tartiner, qui n’a rien à envier aux préparations gélatineuses d’antan !',
|
||||
'end_time': '2024-01-23 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: 'Avis aux nostalgiques des années 1980, la mousse de saumon est de retour dans une présentation adaptée au goût du jour. On utilise une technique sans faille : un saumon frais cuit au micro-ondes et mélangé au robot avec du fromage à la crème et de la crème sure. On obtient ainsi une texture onctueuse à tartiner, qui n’a rien à envier aux préparations gélatineuses d’antan !',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-23 00:00:00',
|
||||
'friendly_name': 'Mealie Snack',
|
||||
'location': '',
|
||||
'message': 'Mousse de saumon',
|
||||
'start_time': '2024-01-22 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Mousse de saumon',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-22 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.mealie_snack',
|
||||
|
||||
@@ -39,17 +39,17 @@
|
||||
# name: test_calendar[calendar.energy_site_buy_tariff-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': '''
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: '''
|
||||
Season: Summer
|
||||
Period: Off peak
|
||||
Price: 0.20/kWh
|
||||
''',
|
||||
'end_time': '2024-01-01 16:00:00',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-01 16:00:00',
|
||||
'friendly_name': 'Energy Site Buy tariff',
|
||||
'location': '',
|
||||
'message': 'Off peak: 0.20/kWh',
|
||||
'start_time': '2023-12-31 21:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Off peak: 0.20/kWh',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2023-12-31 21:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.energy_site_buy_tariff',
|
||||
@@ -99,17 +99,17 @@
|
||||
# name: test_calendar[calendar.energy_site_sell_tariff-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': '''
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: '''
|
||||
Season: Summer
|
||||
Period: Off peak
|
||||
Price: 0.08/kWh
|
||||
''',
|
||||
'end_time': '2024-01-01 16:00:00',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-01 16:00:00',
|
||||
'friendly_name': 'Energy Site Sell tariff',
|
||||
'location': '',
|
||||
'message': 'Off peak: 0.08/kWh',
|
||||
'start_time': '2023-12-31 21:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Off peak: 0.08/kWh',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2023-12-31 21:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.energy_site_sell_tariff',
|
||||
@@ -121,17 +121,17 @@
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple0-calendar.energy_site_buy_tariff][event]
|
||||
ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': '''
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: '''
|
||||
Season: Summer
|
||||
Period: Off peak
|
||||
Price: 0.20/kWh
|
||||
''',
|
||||
'end_time': '2024-01-01 16:00:00',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-01 16:00:00',
|
||||
'friendly_name': 'Energy Site Buy tariff',
|
||||
'location': '',
|
||||
'message': 'Off peak: 0.20/kWh',
|
||||
'start_time': '2023-12-31 21:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Off peak: 0.20/kWh',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2023-12-31 21:00:00',
|
||||
})
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple0-calendar.energy_site_buy_tariff][events]
|
||||
@@ -264,17 +264,17 @@
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple0-calendar.energy_site_sell_tariff][event]
|
||||
ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': '''
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: '''
|
||||
Season: Summer
|
||||
Period: Off peak
|
||||
Price: 0.08/kWh
|
||||
''',
|
||||
'end_time': '2024-01-01 16:00:00',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-01 16:00:00',
|
||||
'friendly_name': 'Energy Site Sell tariff',
|
||||
'location': '',
|
||||
'message': 'Off peak: 0.08/kWh',
|
||||
'start_time': '2023-12-31 21:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Off peak: 0.08/kWh',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2023-12-31 21:00:00',
|
||||
})
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple0-calendar.energy_site_sell_tariff][events]
|
||||
@@ -407,17 +407,17 @@
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple1-calendar.energy_site_buy_tariff][event]
|
||||
ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': '''
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: '''
|
||||
Season: Summer
|
||||
Period: On peak
|
||||
Price: 0.22/kWh
|
||||
''',
|
||||
'end_time': '2024-01-01 21:00:00',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-01 21:00:00',
|
||||
'friendly_name': 'Energy Site Buy tariff',
|
||||
'location': '',
|
||||
'message': 'On peak: 0.22/kWh',
|
||||
'start_time': '2024-01-01 16:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'On peak: 0.22/kWh',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-01 16:00:00',
|
||||
})
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple1-calendar.energy_site_buy_tariff][events]
|
||||
@@ -550,17 +550,17 @@
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple1-calendar.energy_site_sell_tariff][event]
|
||||
ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': '''
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: '''
|
||||
Season: Summer
|
||||
Period: On peak
|
||||
Price: 0.16/kWh
|
||||
''',
|
||||
'end_time': '2024-01-01 21:00:00',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-01 21:00:00',
|
||||
'friendly_name': 'Energy Site Sell tariff',
|
||||
'location': '',
|
||||
'message': 'On peak: 0.16/kWh',
|
||||
'start_time': '2024-01-01 16:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'On peak: 0.16/kWh',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-01 16:00:00',
|
||||
})
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple1-calendar.energy_site_sell_tariff][events]
|
||||
@@ -693,17 +693,17 @@
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple2-calendar.energy_site_buy_tariff][event]
|
||||
ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': '''
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: '''
|
||||
Season: Summer
|
||||
Period: Off peak
|
||||
Price: 0.20/kWh
|
||||
''',
|
||||
'end_time': '2024-01-02 16:00:00',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-02 16:00:00',
|
||||
'friendly_name': 'Energy Site Buy tariff',
|
||||
'location': '',
|
||||
'message': 'Off peak: 0.20/kWh',
|
||||
'start_time': '2024-01-01 21:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Off peak: 0.20/kWh',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-01 21:00:00',
|
||||
})
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple2-calendar.energy_site_buy_tariff][events]
|
||||
@@ -836,17 +836,17 @@
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple2-calendar.energy_site_sell_tariff][event]
|
||||
ReadOnlyDict({
|
||||
'all_day': False,
|
||||
'description': '''
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: False,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: '''
|
||||
Season: Summer
|
||||
Period: Off peak
|
||||
Price: 0.08/kWh
|
||||
''',
|
||||
'end_time': '2024-01-02 16:00:00',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2024-01-02 16:00:00',
|
||||
'friendly_name': 'Energy Site Sell tariff',
|
||||
'location': '',
|
||||
'message': 'Off peak: 0.08/kWh',
|
||||
'start_time': '2024-01-01 21:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Off peak: 0.08/kWh',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2024-01-01 21:00:00',
|
||||
})
|
||||
# ---
|
||||
# name: test_calendar_events[time_tuple2-calendar.energy_site_sell_tariff][events]
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
# name: test_waste_pickup_calendar
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'all_day': True,
|
||||
'description': '',
|
||||
'end_time': '2022-01-07 00:00:00',
|
||||
<CalendarEntityStateAttribute.ALL_DAY: 'all_day'>: True,
|
||||
<CalendarEntityStateAttribute.DESCRIPTION: 'description'>: '',
|
||||
<CalendarEntityStateAttribute.END_TIME: 'end_time'>: '2022-01-07 00:00:00',
|
||||
'friendly_name': 'Twente Milieu',
|
||||
'location': '',
|
||||
'message': 'Christmas tree pickup',
|
||||
'start_time': '2022-01-06 00:00:00',
|
||||
<CalendarEntityStateAttribute.LOCATION: 'location'>: '',
|
||||
<CalendarEntityStateAttribute.MESSAGE: 'message'>: 'Christmas tree pickup',
|
||||
<CalendarEntityStateAttribute.START_TIME: 'start_time'>: '2022-01-06 00:00:00',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'calendar.twente_milieu',
|
||||
|
||||
Reference in New Issue
Block a user