Skip to content

Commit

Permalink
Allow to overwrite template settings in entity config (#317)
Browse files Browse the repository at this point in the history
This is fixing entity templates behaviour, where settings defined in a
template couldn't be changed later in an entity using that template.
  • Loading branch information
grodzik committed Apr 5, 2024
1 parent f180f07 commit 9eadf4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "room-card",
"version": "1.08.03",
"version": "1.08.04",
"description": "Show entities in Home Assistant's Lovelace UI",
"keywords": [
"home-assistant",
Expand Down
4 changes: 2 additions & 2 deletions src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const mapTemplate = (entity: RoomCardEntity, config: RoomCardConfig) => {
if(templatesWithMatchingName.length > 0) {
const templateFromConfig = templatesWithMatchingName[0];

return { stateObj: entity.stateObj, ...entity, ...templateFromConfig.template };
return { stateObj: entity.stateObj, ...templateFromConfig.template, ...entity };
}
}

Expand All @@ -34,4 +34,4 @@ export const getTemplateOrAttribute = (attribute: string | number | RoomCardAttr
}

return attribute;
}
}

0 comments on commit 9eadf4f

Please sign in to comment.