Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the package home-assistant-javascript-templates #128

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,10 @@ order:
- item: hacs
notification: |
[[[
const updates = Object.values(states.update);
const hacsUpdates = updates.filter((update) => {
const { entity_id, state } = update;
return hass.entities[entity_id].platform === 'hacs' && state === 'on';
});
return hacsUpdates.length || '';
const outdatedHacsEntities = Object.values(entities.update).filter(
(entity) => entity.platform === 'hacs' && is_state(entity.entity_id, 'on')
);
return outdatedHacsEntities.length || '';
]]]
- new_item: true
item: info
Expand All @@ -318,7 +316,7 @@ order:
"order": [
{
"item": "hacs",
"notification": "[[[ return Object.values(states.update).filter((update) => hass.entities[update.entity_id].platform === 'hacs' && update.state === 'on').length || '' ]]]"
"notification": "[[[ return Object.values(entities.update).filter((entity) => entity.platform === 'hacs' && is_state(entity.entity_id, 'on')).length || '' ]]]"
},
{
"new_item": true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"typescript-eslint": "^8.2.0"
},
"dependencies": {
"home-assistant-javascript-templates": "^3.1.1",
"home-assistant-javascript-templates": "^4.0.0",
"home-assistant-query-selector": "^4.2.0",
"js-yaml": "^4.1.0"
}
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sidebar-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{
"item": "hacs",
"order": 6,
"notification": "[[[ state_attr('sensor.hacs', 'repositories').length || '' ]]]"
"notification": "[[[ return Object.values(entities.update).filter((entity) => entity.platform === 'hacs' && is_state(entity.entity_id, 'on')).length || '' ]]]"
},
{
"item": "config",
Expand Down
8 changes: 7 additions & 1 deletion sidebar-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ order:
order: 5
- item: hacs
order: 6
notification: '[[[ state_attr("sensor.hacs", "repositories").length || "" ]]]'
notification: |
[[[
const outdatedHacsEntities = Object.values(entities.update).filter(
(entity) => entity.platform === 'hacs' && is_state(entity.entity_id, 'on')
);
return outdatedHacsEntities.length || '';
]]]
- item: config
bottom: true
order: 7
Expand Down
Loading