Skip to content

Commit

Permalink
Merge pull request #1 from daredoes/fix/select-default
Browse files Browse the repository at this point in the history
Select Default to Enabled
  • Loading branch information
daredoes authored Nov 17, 2022
2 parents b57394d + 6350b38 commit 52b8008
Show file tree
Hide file tree
Showing 2 changed files with 9 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": "default-dashboard",
"version": "1.0.2",
"version": "1.0.3",
"description": "Sets the default dashboard for lovelace automatically",
"keywords": [
"home-assistant",
Expand Down
10 changes: 8 additions & 2 deletions src/default-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ let controller: Controller;
},
{ entity_id: 'input_select.default_dashboard' },
);
log('Reloading the page for new options');
location.replace('/');
hass.callService(
'input_select',
'select_option',
{
option: 'enabled',
},
{ entity_id: 'input_select.default_dashboard' },
);
return;
} else if (my_lovelace_url === 'disabled') {
await controller.disable();
Expand Down

0 comments on commit 52b8008

Please sign in to comment.