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

Auto-discover Home Assistant when running inside an add-on #3283

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

felipecrs
Copy link
Contributor

Add-ons have SUPERVISOR_TOKEN set as environment variable (for example Terminal add-on when running from VS Code Remote SSH. But even the regular VS Code add-on should have it.

@felipecrs
Copy link
Contributor Author

@@ -54,6 +54,10 @@ export class ConfigurationService implements IConfigurationService {
if (!this.token && process.env.HASS_TOKEN) {
this.token = process.env.HASS_TOKEN;
}
if (!this.url && !this.token && process.env.SUPERVISOR_TOKEN) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what the above HASS_SERVER & HASS_TOKEN originally tried to solve.

That said, not against this addition as it allows a little clean up on the add-on part.

../Frenck

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frenck, only the VS Code add-on exposes HASS_SERVER and HASS_TOKEN. This change is mainly for other add-ons, like Advanced Terminal.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I get that, but I can clean that part up after this one 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. Great.

Copy link
Collaborator

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @felipecrs 👍

../Frenck

@frenck frenck added the enhancement New feature or request label Feb 20, 2025
@frenck frenck merged commit 6c76061 into keesschollaart81:dev Feb 20, 2025
@felipecrs felipecrs deleted the auto-discover-addon branch February 20, 2025 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants