[alarm] Include type='alarm' in Alarm.to_dict().

This is for compatibility with other backend/frontend components who
expect valid entities on events or responses, and hence may break if
`type` is not specified.
This commit is contained in:
Fabio Manganiello 2023-12-18 01:13:46 +01:00
parent 29f65371d8
commit aff02e0732
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -329,6 +329,7 @@ class Alarm:
def to_dict(self) -> dict:
return {
'id': self.name,
'type': 'alarm',
'name': self.name,
'when': self.when,
'next_run': self.get_next(),