Fix hard machine relay targeting
This commit is contained in:
@@ -124,7 +124,7 @@ trait selfserve_lane_relay_controller_t
|
||||
*/
|
||||
public function setMachineRelayStatusHard(bool $on): bool
|
||||
{
|
||||
return $this->setRelayStatusHard(selfserve_lane_relay::MACHINE_PROGRAM_PICKER, $on);
|
||||
return $this->setRelayStatusHard(selfserve_lane_relay::MACHINE, $on);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -332,6 +332,20 @@ it('keeps back-to-back get/switch requests ordered through the relay controller'
|
||||
expect($harness->shellyCalls[1]['endpoint'])->toBe('/v2/devices/api/set/switch');
|
||||
});
|
||||
|
||||
it('hard MACHINE relay helper targets the configured MACHINE relay', function (): void {
|
||||
$harness = selfserve_lane_shelly_test_harness();
|
||||
|
||||
$result = $harness->setMachineRelayStatusHard(true);
|
||||
|
||||
expect($result)->toBeTrue();
|
||||
expect($harness->getShellyCallCount('/v2/devices/api/set/switch'))->toBe(1);
|
||||
expect($harness->shellyCalls[0]['payload'])->toMatchArray([
|
||||
'id' => 'relay-machine',
|
||||
'channel' => 0,
|
||||
'on' => true,
|
||||
]);
|
||||
});
|
||||
|
||||
it('executes sequential switch requests used by wash start and stop flows', function (): void {
|
||||
$harness = selfserve_lane_shelly_test_harness();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user