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

Show local network URL used in Home Assistant URL settings #22379

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from
10 changes: 10 additions & 0 deletions src/components/ha-settings-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { customElement, property } from "lit/decorators";
export class HaSettingsRow extends LitElement {
@property({ type: Boolean, reflect: true }) public narrow = false;

@property({ type: Boolean, reflect: true }) public slim = false; // remove padding and min-height

@property({ type: Boolean, attribute: "three-line" })
public threeLine = false;

Expand Down Expand Up @@ -109,6 +111,14 @@ export class HaSettingsRow extends LitElement {
display: flex;
align-items: center;
}
:host([slim]),
:host([slim]) .content,
:host([slim]) ::slotted(ha-switch) {
padding: 0;
}
:host([slim]) .body {
min-height: 0;
}
`;
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/data/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ export interface NetworkConfig {
configured_adapters: string[];
}

export interface NetworkUrls {
internal: string;
external: string;
cloud: string;
}

export const getNetworkConfig = (hass: HomeAssistant) =>
hass.callWS<NetworkConfig>({
type: "network",
Expand All @@ -41,3 +47,8 @@ export const setNetworkConfig = (
configured_adapters: configured_adapters,
},
});

export const getNetworkUrls = (hass: HomeAssistant) =>
hass.callWS<NetworkUrls>({
type: "network/url",
});
6 changes: 2 additions & 4 deletions src/panels/config/cloud/account/cloud-remote-pref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class CloudRemotePref extends LitElement {
class="toggle-unmasked-url"
toggles
.label=${this.hass.localize(
`ui.panel.config.cloud.account.remote.${this._unmaskedUrl ? "hide" : "show"}_url`
`ui.panel.config.common.${this._unmaskedUrl ? "hide" : "show"}_url`
)}
@click=${this._toggleUnmaskedUrl}
.path=${this._unmaskedUrl ? mdiEyeOff : mdiEye}
Expand All @@ -165,9 +165,7 @@ export class CloudRemotePref extends LitElement {
unelevated
>
<ha-svg-icon slot="icon" .path=${mdiContentCopy}></ha-svg-icon>
${this.hass.localize(
"ui.panel.config.cloud.account.remote.copy_link"
)}
${this.hass.localize("ui.panel.config.common.copy_link")}
</ha-button>
</div>

Expand Down
Loading
Loading