Merge pull request #3375 from home-assistant/dev

20190717.0
This commit is contained in:
Paulus Schoutsen 2019-07-17 12:09:36 -07:00 committed by GitHub
commit e5a916032a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 115 additions and 28 deletions

View File

@ -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"

View File

@ -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();

View File

@ -26,7 +26,7 @@ class SearchInput extends LitElement {
@value-changed=${this._filterInputChanged}
>
<iron-icon
icon="mdi:magnify"
icon="hass:magnify"
slot="prefix"
class="prefix"
></iron-icon>
@ -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"
></paper-icon-button>

View File

@ -69,9 +69,10 @@ class StepFlowCreateEntry extends LitElement {
(device) =>
html`
<div class="device">
<b>${device.name}</b><br />
${device.model} (${device.manufacturer})
<div>
<b>${device.name}</b><br />
${device.model} (${device.manufacturer})
</div>
<paper-dropdown-menu-light
label="Area"
.device=${device.id}
@ -157,6 +158,8 @@ class StepFlowCreateEntry extends LitElement {
display: flex;
flex-wrap: wrap;
margin: -4px;
max-height: 600px;
overflow-y: auto;
}
.device {
border: 1px solid var(--divider-color);
@ -178,7 +181,7 @@ class StepFlowCreateEntry extends LitElement {
}
@media all and (max-width: 450px), all and (max-height: 500px) {
.device {
width: auto;
width: 100%;
}
}
`,

View File

@ -18,6 +18,7 @@ import * as Fuse from "fuse.js";
import "../../components/ha-icon-next";
import "../../common/search/search-input";
import { styleMap } from "lit-html/directives/style-map";
interface HandlerObj {
name: string;
@ -29,6 +30,7 @@ class StepFlowPickHandler extends LitElement {
@property() public hass!: HomeAssistant;
@property() public handlers!: string[];
@property() private filter?: string;
private _width?: number;
private _getHandlers = memoizeOne((h: string[], filter?: string) => {
const handlers: HandlerObj[] = h.map((handler) => {
@ -58,11 +60,11 @@ class StepFlowPickHandler extends LitElement {
return html`
<h2>${this.hass.localize("ui.panel.config.integrations.new")}</h2>
<div>
<search-input
.filter=${this.filter}
@value-changed=${this._filterChanged}
></search-input>
<search-input
.filter=${this.filter}
@value-changed=${this._filterChanged}
></search-input>
<div style=${styleMap({ width: `${this._width}px` })}>
${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) {

View File

@ -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 {

View File

@ -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 {

View File

@ -104,10 +104,12 @@ class HaPanelProfile extends EventsMixin(LocalizeMixin(PolymerElement)) {
mfa-modules="[[hass.user.mfa_modules]]"
></ha-mfa-modules-card>
<ha-advanced-mode-card
hass="[[hass]]"
core-user-data="[[_coreUserData]]"
></ha-advanced-mode-card>
<template is="dom-if" if="[[_isAdmin(hass.user)]]">
<ha-advanced-mode-card
hass="[[hass]]"
core-user-data="[[_coreUserData]]"
></ha-advanced-mode-card>
</template>
<ha-refresh-tokens-card
hass="[[hass]]"
@ -168,6 +170,10 @@ class HaPanelProfile extends EventsMixin(LocalizeMixin(PolymerElement)) {
(cred) => cred.auth_provider_type === "homeassistant"
);
}
_isAdmin(user) {
return user.is_admin;
}
}
customElements.define("ha-panel-profile", HaPanelProfile);

View File

@ -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"