mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 06:46:35 +00:00
fixed lint
This commit is contained in:
parent
283400f211
commit
5a39c16437
@ -52,11 +52,11 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
validate_code(code) {
|
validate_code(code) {
|
||||||
if(this.code_format == null){
|
const re = new RegExp(this.code_format);
|
||||||
|
if (this.code_format === null) {
|
||||||
this.code_valid = true;
|
this.code_valid = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var re = new RegExp(this.code_format);
|
|
||||||
this.code_valid = re.test(code);
|
this.code_valid = re.test(code);
|
||||||
},
|
},
|
||||||
entered_code_changed(ev) {
|
entered_code_changed(ev) {
|
||||||
@ -66,7 +66,7 @@ export default new Polymer({
|
|||||||
if (newVal) {
|
if (newVal) {
|
||||||
this.code_format = newVal.attributes.code_format;
|
this.code_format = newVal.attributes.code_format;
|
||||||
this.validate_code(this.entered_code);
|
this.validate_code(this.entered_code);
|
||||||
this.code_input_visible = newVal.attributes.code_format != null;
|
this.code_input_visible = newVal.attributes.code_format !== null;
|
||||||
this.code_input_enabled = (newVal.state === 'armed_home' || newVal.state === 'armed_away' || newVal.state === 'disarmed');
|
this.code_input_enabled = (newVal.state === 'armed_home' || newVal.state === 'armed_away' || newVal.state === 'disarmed');
|
||||||
this.disarm_button_enabled = (newVal.state === 'armed_home' || newVal.state === 'armed_away');
|
this.disarm_button_enabled = (newVal.state === 'armed_home' || newVal.state === 'armed_away');
|
||||||
this.arm_home_button_enabled = newVal.state === 'disarmed';
|
this.arm_home_button_enabled = newVal.state === 'disarmed';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user