Fix missing exception translation in alarm_control_panel (#131280)

pull/127580/merge
epenet 2024-11-22 17:37:24 +01:00 committed by GitHub
parent 9991a3b688
commit 3052e29689
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -275,7 +275,6 @@ class AlarmControlPanelEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_A
"""Check if arm code is required, raise if no code is given."""
if not (_code := self.code_or_default_code(code)) and self.code_arm_required:
raise ServiceValidationError(
f"Arming requires a code but none was given for {self.entity_id}",
translation_domain=DOMAIN,
translation_key="code_arm_required",
translation_placeholders={

View File

@ -138,5 +138,10 @@
}
}
}
},
"exceptions": {
"code_arm_required": {
"message": "Arming requires a code but none was given for {entity_id}."
}
}
}