diff --git a/lib/exposes.js b/lib/exposes.js index dcfb23966ae89..49dccbff98dfc 100644 --- a/lib/exposes.js +++ b/lib/exposes.js @@ -82,15 +82,15 @@ class Lock extends Base { this.features = []; } - withState(property, valueOn, valueOff, description, access=a.ALL) { + withState(property, valueOn, valueOff, description, access=a.ALL, label='state') { assert(!this.endpoint, 'Cannot add feature after adding endpoint'); - this.features.push(new Binary('state', access, valueOn, valueOff).withProperty(property).withDescription(description)); + this.features.push(new Binary(label, access, valueOn, valueOff).withProperty(property).withDescription(description)); return this; } - withLockState(property, description) { + withLockState(property, description, label='lock_state') { assert(!this.endpoint, 'Cannot add feature after adding endpoint'); - this.features.push(new Enum('lock_state', access.STATE, ['not_fully_locked', 'locked', 'unlocked']).withProperty(property).withDescription(description)); + this.features.push(new Enum(label, access.STATE, ['not_fully_locked', 'locked', 'unlocked']).withProperty(property).withDescription(description)); return this; } } @@ -478,7 +478,7 @@ module.exports = { humidity: () => new Numeric('humidity', access.STATE).withUnit('%').withDescription('Measured relative humidity'), illuminance: () => new Numeric('illuminance', access.STATE).withDescription('Raw measured illuminance'), illuminance_lux: () => new Numeric('illuminance_lux', access.STATE).withUnit('lx').withDescription('Measured illuminance in lux'), - keypad_lockout: () => new Lock().withState('keypad_lockout', 'lock1', 'unlock', 'Enables/disables physical input on the device', a.STATE_ALL), + keypad_lockout: () => new Lock().withState('keypad_lockout', 'lock1', 'unlock', 'Enables/disables physical input on the device', a.STATE_ALL, 'keypad_lockout'), led_disabled_night: () => new Binary('led_disabled_night', access.STATE_SET, true, false).withDescription('Enable/disable the LED at night'), light_brightness: () => new Light().withBrightness(), light_brightness_color: () => new Light().withBrightness().withColor((['xy', 'hs'])),