diff --git a/homeassistant/components/backup/config.py b/homeassistant/components/backup/config.py index 927d826aee5..da5a6b5e1de 100644 --- a/homeassistant/components/backup/config.py +++ b/homeassistant/components/backup/config.py @@ -283,7 +283,7 @@ class ScheduleState(StrEnum): NEVER = "never" DAILY = "daily" - CUSTOM = "custom" + CUSTOM_DAYS = "custom_days" MONDAY = "mon" TUESDAY = "tue" WEDNESDAY = "wed" @@ -313,7 +313,7 @@ class BackupSchedule: There are only three possible state types: never, daily, or weekly. """ if self.state is ScheduleState.NEVER or ( - self.state is ScheduleState.CUSTOM and not self.days + self.state is ScheduleState.CUSTOM_DAYS and not self.days ): self._unschedule_next(manager) return @@ -324,7 +324,7 @@ class BackupSchedule: CRON_PATTERN_DAILY.format(m=time.minute, h=time.hour), manager, ) - elif self.state is ScheduleState.CUSTOM: + elif self.state is ScheduleState.CUSTOM_DAYS: self._schedule_next( CRON_PATTERN_WEEKLY.format( m=time.minute, diff --git a/tests/components/backup/snapshots/test_websocket.ambr b/tests/components/backup/snapshots/test_websocket.ambr index e065e543fa8..1de6415c38a 100644 --- a/tests/components/backup/snapshots/test_websocket.ambr +++ b/tests/components/backup/snapshots/test_websocket.ambr @@ -468,7 +468,7 @@ 'mon', 'sun', ]), - 'state': 'custom', + 'state': 'custom_days', 'time': None, }), }), @@ -1169,7 +1169,7 @@ 'mon', 'sun', ]), - 'state': 'custom', + 'state': 'custom_days', 'time': None, }), }), @@ -1206,7 +1206,7 @@ 'mon', 'sun', ]), - 'state': 'custom', + 'state': 'custom_days', 'time': None, }), }), diff --git a/tests/components/backup/test_websocket.py b/tests/components/backup/test_websocket.py index 7d5e88fdc6f..56479caae5e 100644 --- a/tests/components/backup/test_websocket.py +++ b/tests/components/backup/test_websocket.py @@ -1051,7 +1051,7 @@ async def test_agents_info( "last_completed_automatic_backup": None, "schedule": { "days": ["mon", "sun"], - "state": "custom", + "state": "custom_days", "time": None, }, }, @@ -1113,7 +1113,7 @@ async def test_config_info( { "type": "backup/config/update", "create_backup": {"agent_ids": ["test-agent"]}, - "schedule": {"days": ["mon", "sun"], "state": "custom"}, + "schedule": {"days": ["mon", "sun"], "state": "custom_days"}, }, { "type": "backup/config/update", @@ -1380,7 +1380,7 @@ async def test_config_update_errors( { "type": "backup/config/update", "create_backup": {"agent_ids": ["test.test-agent"]}, - "schedule": {"days": ["wed", "fri"], "state": "custom"}, + "schedule": {"days": ["wed", "fri"], "state": "custom_days"}, } ], "2024-11-11T04:45:00+01:00", @@ -1418,7 +1418,7 @@ async def test_config_update_errors( { "type": "backup/config/update", "create_backup": {"agent_ids": ["test.test-agent"]}, - "schedule": {"days": [], "state": "custom"}, + "schedule": {"days": [], "state": "custom_days"}, } ], "2024-11-11T04:45:00+01:00",