Skip to content

Commit

Permalink
feat: Use common motor_state values for Bosch & Lumi devices (#7470)
Browse files Browse the repository at this point in the history
* fix: Use common `motor_state` values for Bosch BCMT-SLZ

Use `stopped` instead of `idle` so integrations can expect a common, minimum set of `motor_state` values.

* fix: Use common `motor_state` values for Lumi devices
  • Loading branch information
burmistrzak committed Apr 30, 2024
1 parent 6a544cc commit 5f578b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/devices/bosch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const stateDeviceMode: KeyValue = {

// BMCT
const stateMotor: KeyValue = {
'idle': 0x00,
'stopped': 0x00,
'opening': 0x01,
'closing': 0x02,
};
Expand Down
6 changes: 3 additions & 3 deletions src/devices/lumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,7 @@ const definitions: Definition[] = [
exposes: [e.cover_position().setAccess('state', ea.ALL), e.battery(),
e.binary('running', ea.STATE, true, false)
.withDescription('Whether the motor is moving or not'),
e.enum('motor_state', ea.STATE, ['closing', 'opening', 'stop'])
e.enum('motor_state', ea.STATE, ['closing', 'opening', 'stopped'])
.withDescription('The current state of the motor.'), e.power_outage_count()],
extend: [lumiZigbeeOTA()],
},
Expand Down Expand Up @@ -1881,7 +1881,7 @@ const definitions: Definition[] = [
.withDescription('Pulling curtains by hand starts the motor'),
e.binary('running', ea.STATE, true, false)
.withDescription('Whether the motor is moving or not'),
e.enum('motor_state', ea.STATE, ['closing', 'opening', 'stop'])
e.enum('motor_state', ea.STATE, ['closing', 'opening', 'stopped'])
.withDescription('The current state of the motor.'), e.power_outage_count()],
extend: [lumiZigbeeOTA()],
},
Expand All @@ -1906,7 +1906,7 @@ const definitions: Definition[] = [
exposes: [e.cover_position().setAccess('state', ea.ALL), e.battery().withAccess(ea.STATE_GET), e.device_temperature(),
e.binary('charging_status', ea.STATE_GET, true, false)
.withDescription('The current charging status.'),
e.enum('motor_state', ea.STATE, ['declining', 'rising', 'pause', 'blocked'])
e.enum('motor_state', ea.STATE, ['closing', 'opening', 'stopped', 'blocked'])
.withDescription('The current state of the motor.'),
e.binary('running', ea.STATE, true, false)
.withDescription('Whether the motor is moving or not')],
Expand Down

0 comments on commit 5f578b1

Please sign in to comment.