Skip to content

Commit

Permalink
[enocean] fix typos
Browse files Browse the repository at this point in the history
Rename constants name from *RESPONE to *RESPONSE

Signed-off-by: Zhivka Dimova <zhivka.dimova@myforest.net>
  • Loading branch information
lovery committed Sep 20, 2024
1 parent 5c6b74b commit 08099f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public abstract class D2_01 extends _VLDMessage {

protected static final byte CMD_ACTUATOR_SET_STATUS = 0x01;
protected static final byte CMD_ACTUATOR_STATUS_QUERY = 0x03;
protected static final byte CMD_ACTUATOR_STATUS_RESPONE = 0x04;
protected static final byte CMD_ACTUATOR_STATUS_RESPONSE = 0x04;
protected static final byte CMD_ACTUATOR_MEASUREMENT_QUERY = 0x06;
protected static final byte CMD_ACTUATOR_MEASUREMENT_RESPONE = 0x07;
protected static final byte CMD_ACTUATOR_MEASUREMENT_RESPONSE = 0x07;

protected static final byte ALL_CHANNELS_MASK = 0x1e;
protected static final byte CHANNEL_A_MASK = 0x00;
Expand Down Expand Up @@ -85,7 +85,7 @@ protected void setSwitchingQueryData(byte outputChannel) {
}

protected State getSwitchingData() {
if (getCMD() == CMD_ACTUATOR_STATUS_RESPONE) {
if (getCMD() == CMD_ACTUATOR_STATUS_RESPONSE) {
return OnOffType.from((bytes[bytes.length - 1] & OUTPUT_VALUE_MASK) != STATUS_SWITCHING_OFF);
}

Expand All @@ -97,7 +97,8 @@ protected byte getChannel() {
}

protected State getSwitchingData(byte channel) {
if (getCMD() == CMD_ACTUATOR_STATUS_RESPONE && (getChannel() == channel || getChannel() == ALL_CHANNELS_MASK)) {
if (getCMD() == CMD_ACTUATOR_STATUS_RESPONSE
&& (getChannel() == channel || getChannel() == ALL_CHANNELS_MASK)) {
return OnOffType.from((bytes[bytes.length - 1] & OUTPUT_VALUE_MASK) != STATUS_SWITCHING_OFF);
}

Expand Down Expand Up @@ -126,7 +127,7 @@ protected void setDimmingData(Command command, byte outputChannel, Configuration
}

protected State getDimmingData() {
if (getCMD() == CMD_ACTUATOR_STATUS_RESPONE) {
if (getCMD() == CMD_ACTUATOR_STATUS_RESPONSE) {
return new PercentType((bytes[bytes.length - 1] & OUTPUT_VALUE_MASK));
}

Expand All @@ -142,7 +143,7 @@ protected void setPowerMeasurementQueryData(byte outputChannel) {
}

protected State getEnergyMeasurementData() {
if (getCMD() == CMD_ACTUATOR_MEASUREMENT_RESPONE) {
if (getCMD() == CMD_ACTUATOR_MEASUREMENT_RESPONSE) {
float factor = 1;

switch (bytes[1] >>> 5) {
Expand All @@ -169,7 +170,7 @@ protected State getEnergyMeasurementData() {
}

protected State getPowerMeasurementData() {
if (getCMD() == CMD_ACTUATOR_MEASUREMENT_RESPONE) {
if (getCMD() == CMD_ACTUATOR_MEASUREMENT_RESPONSE) {
float factor = 1;

switch (bytes[1] >>> 5) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class D2_05_00 extends _VLDMessage {
protected static final byte CMD_ACTUATOR_SET_POSITION = 0x01;
protected static final byte CMD_ACTUATOR_STOP = 0x02;
protected static final byte CMD_ACTUATOR_POSITION_QUERY = 0x03;
protected static final byte CMD_ACTUATOR_POSITION_RESPONE = 0x04;
protected static final byte CMD_ACTUATOR_POSITION_RESPONSE = 0x04;

protected static final byte ALL_CHANNELS_MASK = 0x1e;
protected static final byte CHANNEL_A_MASK = 0x00;
Expand Down Expand Up @@ -86,7 +86,7 @@ protected void setPositionQueryData(byte outputChannel) {
}

protected State getPositionData() {
if (getCMD() == CMD_ACTUATOR_POSITION_RESPONE) {
if (getCMD() == CMD_ACTUATOR_POSITION_RESPONSE) {
int position = bytes[0] & 0x7f;
if (position != 127) {
return new PercentType(position);
Expand Down

0 comments on commit 08099f8

Please sign in to comment.