Add handling for self-serve machine signals in edge agent
This commit is contained in:
@@ -148,6 +148,25 @@ class selfserve_machine_signal
|
||||
$gateway = (new edge_gateway_manager())->authenticateGateway($gatewayId, $agentToken);
|
||||
$departmentId = (int)$gateway->department_id->value();
|
||||
|
||||
return $this->recordEdgeGatewaySignalForDepartment($gatewayId, $departmentId, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string,mixed> $payload
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
public function recordBrokerEdgeGatewaySignal(int $gatewayId, array $payload): array
|
||||
{
|
||||
$gateway = (new edge_gateway_manager())->getGateway($gatewayId);
|
||||
return $this->recordEdgeGatewaySignalForDepartment($gatewayId, (int)$gateway['department_id'], $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string,mixed> $payload
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
private function recordEdgeGatewaySignalForDepartment(int $gatewayId, int $departmentId, array $payload): array
|
||||
{
|
||||
return $this->recordCloudShellySignal(
|
||||
$departmentId,
|
||||
isset($payload['lane_id']) ? (int)$payload['lane_id'] : null,
|
||||
|
||||
Reference in New Issue
Block a user