mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Update eslint
This commit is contained in:
parent
a60ebb040c
commit
cdc1437944
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"parser": "babel-eslint",
|
||||||
"extends": "airbnb/base",
|
"extends": "airbnb/base",
|
||||||
"globals": {
|
"globals": {
|
||||||
"__DEV__": false,
|
"__DEV__": false,
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
"babel-preset-es2015": "^6.0.0",
|
"babel-preset-es2015": "^6.0.0",
|
||||||
"bower": "^1.6.5",
|
"bower": "^1.6.5",
|
||||||
"eslint": "^1.10.3",
|
"eslint": "^1.10.3",
|
||||||
"eslint-config-airbnb": "^0.1.0",
|
|
||||||
"html-minifier": "^1.0.0",
|
"html-minifier": "^1.0.0",
|
||||||
|
"eslint-config-airbnb": "^3.1.0",
|
||||||
"vulcanize": "^1.14.0",
|
"vulcanize": "^1.14.0",
|
||||||
"webpack": "^1.12"
|
"webpack": "^1.12"
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,6 @@ export default new Polymer({
|
|||||||
|
|
||||||
entitySelected(ev) {
|
entitySelected(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this.fire('entity-selected', {entityId: ev.model.entity.entityId});
|
this.fire('entity-selected', { entityId: ev.model.entity.entityId });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -40,7 +40,7 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
listeners: {
|
listeners: {
|
||||||
'tap': 'badgeTap',
|
tap: 'badgeTap',
|
||||||
},
|
},
|
||||||
|
|
||||||
badgeTap(ev) {
|
badgeTap(ev) {
|
||||||
|
@ -72,7 +72,7 @@ export default new Polymer({
|
|||||||
service = turnOn ? 'turn_on' : 'turn_off';
|
service = turnOn ? 'turn_on' : 'turn_off';
|
||||||
}
|
}
|
||||||
|
|
||||||
serviceActions.callService(domain, service, {entity_id: this.stateObj.entityId})
|
serviceActions.callService(domain, service, { entity_id: this.stateObj.entityId })
|
||||||
.then(() => this.forceStateChange());
|
.then(() => this.forceStateChange());
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -21,7 +21,7 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
listeners: {
|
listeners: {
|
||||||
'tap': 'badgeTap',
|
tap: 'badgeTap',
|
||||||
},
|
},
|
||||||
|
|
||||||
badgeTap(ev) {
|
badgeTap(ev) {
|
||||||
|
@ -22,6 +22,6 @@ export default new Polymer({
|
|||||||
|
|
||||||
eventSelected(ev) {
|
eventSelected(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this.fire('event-selected', {eventType: ev.model.event.event});
|
this.fire('event-selected', { eventType: ev.model.event.event });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -25,10 +25,10 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
listeners: {
|
listeners: {
|
||||||
'mousedown': 'onMouseDown',
|
mousedown: 'onMouseDown',
|
||||||
'mouseup': 'onMouseUp',
|
mouseup: 'onMouseUp',
|
||||||
'touchstart': 'onTouchStart',
|
touchstart: 'onTouchStart',
|
||||||
'touchend': 'onTouchEnd',
|
touchend: 'onTouchEnd',
|
||||||
},
|
},
|
||||||
|
|
||||||
onMouseDown(ev) {
|
onMouseDown(ev) {
|
||||||
@ -82,13 +82,13 @@ export default new Polymer({
|
|||||||
onColorSelect(x, y) {
|
onColorSelect(x, y) {
|
||||||
const data = this.context.getImageData(x, y, 1, 1).data;
|
const data = this.context.getImageData(x, y, 1, 1).data;
|
||||||
|
|
||||||
this.setColor({r: data[0], g: data[1], b: data[2]});
|
this.setColor({ r: data[0], g: data[1], b: data[2] });
|
||||||
},
|
},
|
||||||
|
|
||||||
setColor(rgb) {
|
setColor(rgb) {
|
||||||
this.color = rgb;
|
this.color = rgb;
|
||||||
|
|
||||||
this.fire('colorselected', {rgb: this.color});
|
this.fire('colorselected', { rgb: this.color });
|
||||||
},
|
},
|
||||||
|
|
||||||
ready() {
|
ready() {
|
||||||
|
@ -84,7 +84,7 @@ export default new Polymer({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cards._columns[increaseIndex()].push(name);
|
cards._columns[increaseIndex()].push(name);
|
||||||
cards[name] = {entities, groupEntity};
|
cards[name] = { entities, groupEntity };
|
||||||
}
|
}
|
||||||
|
|
||||||
byDomain.keySeq().sortBy(domain => getPriority(domain))
|
byDomain.keySeq().sortBy(domain => getPriority(domain))
|
||||||
|
@ -30,7 +30,7 @@ export default new Polymer({
|
|||||||
serviceClicked(ev) {
|
serviceClicked(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this.fire(
|
this.fire(
|
||||||
'service-selected', {domain: ev.model.domain,
|
'service-selected', { domain: ev.model.domain,
|
||||||
service: ev.model.service});
|
service: ev.model.service });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -70,12 +70,12 @@ export default new Polymer({
|
|||||||
titlePosition: 'none',
|
titlePosition: 'none',
|
||||||
vAxes: {
|
vAxes: {
|
||||||
// Adds units to the left hand side of the graph
|
// Adds units to the left hand side of the graph
|
||||||
0: {title: unit},
|
0: { title: unit },
|
||||||
},
|
},
|
||||||
hAxis: {
|
hAxis: {
|
||||||
format: 'H:mm',
|
format: 'H:mm',
|
||||||
},
|
},
|
||||||
chartArea: { left: '60', width: '95%'},
|
chartArea: { left: '60', width: '95%' },
|
||||||
explorer: {
|
explorer: {
|
||||||
actions: ['dragToZoom', 'rightClickToReset', 'dragToPan'],
|
actions: ['dragToZoom', 'rightClickToReset', 'dragToPan'],
|
||||||
keepInBounds: true,
|
keepInBounds: true,
|
||||||
|
@ -44,7 +44,7 @@ export default new Polymer({
|
|||||||
|
|
||||||
computeGroupedStateHistory(isLoading, stateHistory) {
|
computeGroupedStateHistory(isLoading, stateHistory) {
|
||||||
if (isLoading || !stateHistory) {
|
if (isLoading || !stateHistory) {
|
||||||
return {line: [], timeline: []};
|
return { line: [], timeline: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
const lineChartDevices = {};
|
const lineChartDevices = {};
|
||||||
@ -75,7 +75,7 @@ export default new Polymer({
|
|||||||
const unitStates = Object.keys(lineChartDevices).map(
|
const unitStates = Object.keys(lineChartDevices).map(
|
||||||
(unit) => [unit, lineChartDevices[unit]]);
|
(unit) => [unit, lineChartDevices[unit]]);
|
||||||
|
|
||||||
return {line: unitStates, timeline: timelineDevices};
|
return { line: unitStates, timeline: timelineDevices };
|
||||||
},
|
},
|
||||||
|
|
||||||
googleApiLoaded() {
|
googleApiLoaded() {
|
||||||
|
@ -91,9 +91,10 @@ export default new Polymer({
|
|||||||
|
|
||||||
navigator.serviceWorker.register('./service_worker.js').catch(err => {
|
navigator.serviceWorker.register('./service_worker.js').catch(err => {
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
|
/* eslint-disable no-console */
|
||||||
console.warn('Unable to register service worker', err);
|
console.warn('Unable to register service worker', err);
|
||||||
|
/* eslint-enable no-console */
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -47,7 +47,7 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
listeners: {
|
listeners: {
|
||||||
'keydown': 'passwordKeyDown',
|
keydown: 'passwordKeyDown',
|
||||||
'loginButton.tap': 'validatePassword',
|
'loginButton.tap': 'validatePassword',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ export default new Polymer({
|
|||||||
|
|
||||||
template: {
|
template: {
|
||||||
type: String,
|
type: String,
|
||||||
|
/* eslint-disable max-len */
|
||||||
value: '{%- if is_state("device_tracker.paulus", "home") and \n' +
|
value: '{%- if is_state("device_tracker.paulus", "home") and \n' +
|
||||||
' is_state("device_tracker.anne_therese", "home") -%}\n' +
|
' is_state("device_tracker.anne_therese", "home") -%}\n' +
|
||||||
'\n' +
|
'\n' +
|
||||||
@ -55,6 +56,7 @@ export default new Polymer({
|
|||||||
' {%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}\n' +
|
' {%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}\n' +
|
||||||
' {{ state.name | lower }} is {{state.state}} {{- state.attributes.unit_of_measurement}}\n' +
|
' {{ state.name | lower }} is {{state.state}} {{- state.attributes.unit_of_measurement}}\n' +
|
||||||
'{%- endfor -%}.',
|
'{%- endfor -%}.',
|
||||||
|
/* eslint-enable max-len */
|
||||||
observer: 'templateChanged',
|
observer: 'templateChanged',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -7,13 +7,13 @@ const { serviceActions } = hass;
|
|||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'more-info-alarm_control_panel',
|
is: 'more-info-alarm_control_panel',
|
||||||
handleDisarmTap() {
|
handleDisarmTap() {
|
||||||
this.callService('alarm_disarm', {code: this.enteredCode});
|
this.callService('alarm_disarm', { code: this.enteredCode });
|
||||||
},
|
},
|
||||||
handleHomeTap() {
|
handleHomeTap() {
|
||||||
this.callService('alarm_arm_home', {code: this.enteredCode});
|
this.callService('alarm_arm_home', { code: this.enteredCode });
|
||||||
},
|
},
|
||||||
handleAwayTap() {
|
handleAwayTap() {
|
||||||
this.callService('alarm_arm_away', {code: this.enteredCode});
|
this.callService('alarm_arm_away', { code: this.enteredCode });
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
stateObj: {
|
stateObj: {
|
||||||
|
@ -25,16 +25,16 @@ export default new Polymer({
|
|||||||
|
|
||||||
onMoveUpTap() {
|
onMoveUpTap() {
|
||||||
serviceActions.callService('rollershutter', 'move_up',
|
serviceActions.callService('rollershutter', 'move_up',
|
||||||
{entity_id: this.stateObj.entityId});
|
{ entity_id: this.stateObj.entityId });
|
||||||
},
|
},
|
||||||
|
|
||||||
onMoveDownTap() {
|
onMoveDownTap() {
|
||||||
serviceActions.callService('rollershutter', 'move_down',
|
serviceActions.callService('rollershutter', 'move_down',
|
||||||
{entity_id: this.stateObj.entityId});
|
{ entity_id: this.stateObj.entityId });
|
||||||
},
|
},
|
||||||
|
|
||||||
onStopTap() {
|
onStopTap() {
|
||||||
serviceActions.callService('rollershutter', 'stop',
|
serviceActions.callService('rollershutter', 'stop',
|
||||||
{entity_id: this.stateObj.entityId});
|
{ entity_id: this.stateObj.entityId });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -16,7 +16,7 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
listeners: {
|
listeners: {
|
||||||
'tap': 'cardTapped',
|
tap: 'cardTapped',
|
||||||
},
|
},
|
||||||
|
|
||||||
cardTapped(ev) {
|
cardTapped(ev) {
|
||||||
|
@ -2,7 +2,7 @@ import hass from '../util/home-assistant-js-instance';
|
|||||||
|
|
||||||
const { authActions, localStoragePreferences } = hass;
|
const { authActions, localStoragePreferences } = hass;
|
||||||
|
|
||||||
export default function(authToken, rememberAuth) {
|
export default function (authToken, rememberAuth) {
|
||||||
authActions.validate(authToken, {
|
authActions.validate(authToken, {
|
||||||
rememberAuth,
|
rememberAuth,
|
||||||
useStreaming: localStoragePreferences.useStreaming,
|
useStreaming: localStoragePreferences.useStreaming,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user