Skip to content

Commit

Permalink
Merge pull request #551 from PhilippEngler/FixDeviceCommandNameCheck
Browse files Browse the repository at this point in the history
FIX:  hasCommand for DevicePresetPosition, DeviceSavePresetPosition and DeviceDeletePresetPosition
  • Loading branch information
bropat authored Sep 28, 2024
2 parents de6288f + d0b0cfb commit ca5362a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/http/station.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10739,7 +10739,7 @@ export class Station extends TypedEmitter<StationEvents> {
if (device.getStationSerial() !== this.getSerial()) {
throw new WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
}
if (!device.hasCommand(CommandName.DevicePanAndTilt)) {
if (!device.hasCommand(CommandName.DevicePresetPosition)) {
throw new NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
}
if (!(position in PresetPositionType)) {
Expand Down Expand Up @@ -10771,7 +10771,7 @@ export class Station extends TypedEmitter<StationEvents> {
if (device.getStationSerial() !== this.getSerial()) {
throw new WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
}
if (!device.hasCommand(CommandName.DevicePanAndTilt)) {
if (!device.hasCommand(CommandName.DeviceSavePresetPosition)) {
throw new NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
}
if (!(position in PresetPositionType)) {
Expand Down Expand Up @@ -10803,7 +10803,7 @@ export class Station extends TypedEmitter<StationEvents> {
if (device.getStationSerial() !== this.getSerial()) {
throw new WrongStationError("Device is not managed by this station", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
}
if (!device.hasCommand(CommandName.DevicePanAndTilt)) {
if (!device.hasCommand(CommandName.DeviceDeletePresetPosition)) {
throw new NotSupportedError("This functionality is not implemented or supported by this device", { context: { device: device.getSerial(), station: this.getSerial(), commandName: commandData.name, commandValue: commandData.value } });
}
if (!(position in PresetPositionType)) {
Expand Down

0 comments on commit ca5362a

Please sign in to comment.