diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml new file mode 100644 index 0000000000..26dbc41ddd --- /dev/null +++ b/azure-pipelines-release.yml @@ -0,0 +1,67 @@ +# https://dev.azure.com/home-assistant + +trigger: + batch: true + tags: + include: + - "*" +pr: none +variables: + - name: versionBuilder + value: "5.2" + - group: github + - group: twine + +stages: + - stage: "Validate" + jobs: + - job: "VersionValidate" + pool: + vmImage: "ubuntu-latest" + steps: + - task: UsePythonVersion@0 + displayName: "Use Python 3.7" + inputs: + versionSpec: "3.7" + - script: | + setup_version="$(python setup.py -V)" + branch_version="$(Build.SourceBranchName)" + + if [ "${setup_version}" != "${branch_version}" ]; then + echo "Version of tag ${branch_version} don't match with ${setup_version}!" + exit 1 + fi + displayName: "Check version of branch/tag" + - script: | + sudo apt-get install -y --no-install-recommends \ + jq curl + + release="$(Build.SourceBranchName)" + created_by="$(curl -s https://api.github.com/repos/home-assistant/home-assistant/releases/tags/${release} | jq --raw-output '.author.login')" + + if [[ "${created_by}" =~ ^(balloob)$ ]]; then + exit 0 + fi + + echo "${created_by} is not allowed to create an release!" + exit 1 + displayName: "Check rights" + + - stage: "Build" + jobs: + - job: "ReleasePython" + pool: + vmImage: "ubuntu-latest" + steps: + - task: UsePythonVersion@0 + displayName: "Use Python 3.7" + inputs: + versionSpec: "3.7" + - task: NodeTool@0 + displayName: "Use Node 12.1" + inputs: + versionSpec: "12.1" + - script: pip install twine wheel + displayName: "Install tools" + - script: script/release + displayName: "Build and release package" diff --git a/build-scripts/gulp/entry-html.js b/build-scripts/gulp/entry-html.js index eb26093925..c322aac4ec 100644 --- a/build-scripts/gulp/entry-html.js +++ b/build-scripts/gulp/entry-html.js @@ -86,7 +86,7 @@ gulp.task("gen-index-app-dev", (done) => { es5CoreJS: "/frontend_es5/core.js", es5CustomPanelJS: "/frontend_es5/custom-panel.js", es5HassIconsJS: "/frontend_es5/hass-icons.js", - }); + }).replace(/#THEMEC/g, "{{ theme_color }}"); fs.outputFileSync(path.resolve(config.root, "index.html"), content); done(); diff --git a/src/common/search/search-input.ts b/src/common/search/search-input.ts index deb36885b7..65b29881e9 100644 --- a/src/common/search/search-input.ts +++ b/src/common/search/search-input.ts @@ -26,7 +26,7 @@ class SearchInput extends LitElement { @value-changed=${this._filterInputChanged} > @@ -36,7 +36,7 @@ class SearchInput extends LitElement { slot="suffix" class="suffix" @click=${this._clearSearch} - icon="mdi:close" + icon="hass:close" alt="Clear" title="Clear" > diff --git a/src/dialogs/config-flow/step-flow-create-entry.ts b/src/dialogs/config-flow/step-flow-create-entry.ts index ac38ba95ed..5ecc457a40 100644 --- a/src/dialogs/config-flow/step-flow-create-entry.ts +++ b/src/dialogs/config-flow/step-flow-create-entry.ts @@ -69,9 +69,10 @@ class StepFlowCreateEntry extends LitElement { (device) => html`
- ${device.name}
- ${device.model} (${device.manufacturer}) - +
+ ${device.name}
+ ${device.model} (${device.manufacturer}) +
{ const handlers: HandlerObj[] = h.map((handler) => { @@ -58,11 +60,11 @@ class StepFlowPickHandler extends LitElement { return html`

${this.hass.localize("ui.panel.config.integrations.new")}

-
- + +
${handlers.map( (handler: HandlerObj) => html` @@ -80,6 +82,11 @@ class StepFlowPickHandler extends LitElement { private async _filterChanged(e) { this.filter = e.detail.value; + + // Store the width so that when we search, box doesn't jump + if (this._width === undefined) { + this._width = this.shadowRoot!.querySelector("div")!.clientWidth; + } } private async _handlerPicked(ev) { diff --git a/src/dialogs/notifications/notification-drawer.js b/src/dialogs/notifications/notification-drawer.js index 0b1255a762..2b574b13d9 100644 --- a/src/dialogs/notifications/notification-drawer.js +++ b/src/dialogs/notifications/notification-drawer.js @@ -34,6 +34,8 @@ export class HuiNotificationDrawer extends EventsMixin( .notifications { overflow-y: auto; padding-top: 16px; + height: calc(100% - 65px); + box-sizing: border-box; } .notification { diff --git a/src/panels/lovelace/cards/hui-thermostat-card.ts b/src/panels/lovelace/cards/hui-thermostat-card.ts index 6b1c07a549..4049549649 100644 --- a/src/panels/lovelace/cards/hui-thermostat-card.ts +++ b/src/panels/lovelace/cards/hui-thermostat-card.ts @@ -37,7 +37,7 @@ const thermostatConfig = { }; const modeIcons: { [mode in HvacMode]: string } = { - auto: "hass:autorenew", + auto: "hass:calendar-repeat", heat_cool: "hass:autorenew", heat: "hass:fire", cool: "hass:snowflake", @@ -204,10 +204,13 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { !changedProps.has("_jQuery") && (!oldHass || oldHass.states[this._config.entity] !== stateObj) ) { - const [sliderValue, uiValue] = this._genSliderValue(stateObj); + const [sliderValue, uiValue, _sliderType] = this._genSliderValue( + stateObj + ); this._jQuery("#thermostat", this.shadowRoot).roundSlider({ value: sliderValue, + sliderType: _sliderType, }); this._updateSetTemp(uiValue); } @@ -250,13 +253,7 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { this._roundSliderStyle = loaded.roundSliderStyle; this._jQuery = loaded.jQuery; - const _sliderType = - stateObj.attributes.target_temp_low && - stateObj.attributes.target_temp_high - ? "range" - : "min-range"; - - const [sliderValue, uiValue] = this._genSliderValue(stateObj); + const [sliderValue, uiValue, _sliderType] = this._genSliderValue(stateObj); this._jQuery("#thermostat", this.shadowRoot).roundSlider({ ...thermostatConfig, @@ -272,7 +269,10 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { this._updateSetTemp(uiValue); } - private _genSliderValue(stateObj: ClimateEntity): [string | number, string] { + private _genSliderValue( + stateObj: ClimateEntity + ): [string | number, string, string] { + let sliderType: string; let sliderValue: string | number; let uiValue: string; @@ -280,6 +280,7 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { stateObj.attributes.target_temp_low && stateObj.attributes.target_temp_high ) { + sliderType = "range"; sliderValue = `${stateObj.attributes.target_temp_low}, ${ stateObj.attributes.target_temp_high }`; @@ -291,6 +292,7 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { false ); } else { + sliderType = "min-range"; sliderValue = stateObj.attributes.temperature; uiValue = stateObj.attributes.temperature !== null @@ -298,7 +300,7 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { : ""; } - return [sliderValue, uiValue]; + return [sliderValue, uiValue, sliderType]; } private _updateSetTemp(value: string): void { diff --git a/src/panels/profile/ha-panel-profile.js b/src/panels/profile/ha-panel-profile.js index 1cefa17524..47577bc73c 100644 --- a/src/panels/profile/ha-panel-profile.js +++ b/src/panels/profile/ha-panel-profile.js @@ -104,10 +104,12 @@ class HaPanelProfile extends EventsMixin(LocalizeMixin(PolymerElement)) { mfa-modules="[[hass.user.mfa_modules]]" > - + cred.auth_provider_type === "homeassistant" ); } + + _isAdmin(user) { + return user.is_admin; + } } customElements.define("ha-panel-profile", HaPanelProfile); diff --git a/src/translations/en.json b/src/translations/en.json index 76a38048e3..84ed63da12 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -173,7 +173,7 @@ "off": "[%key:state::default::off%]", "heat": "Heat", "cool": "Cool", - "heat_cool": "Auto", + "heat_cool": "Heat/Cool", "auto": "Auto", "dry": "Dry", "fan_only": "Fan only"