\App\IqrfNetModule\ModelsStandardLightManager

Tool for managing standard lights in the IQMESH network

Summary

Methods
Properties
Constants
__construct()
enumerate()
getPower()
setPower()
incrementPower()
decrementPower()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
convertEntityToArray()
$request
$wsClient
N/A

Properties

$request

$request : \App\IqrfNetModule\Requests\ApiRequest

Type

normal — JSON API request

$wsClient

$wsClient : \App\IqrfNetModule\Models\WebSocketClient

Type

normal — WebSocket client

Methods

__construct()

__construct(\App\IqrfNetModule\Requests\ApiRequest  $request, \App\IqrfNetModule\Models\WebSocketClient  $wsClient) : mixed

Constructor

Parameters

\App\IqrfNetModule\Requests\ApiRequest $request

JSON API request

\App\IqrfNetModule\Models\WebSocketClient $wsClient

WebSocket client

Returns

mixed

enumerate()

enumerate(int  $address) : array

Enumerates a IQRF Standard light device

Parameters

int $address

Network device address

Throws

\App\IqrfNetModule\Exceptions\DpaErrorException
\App\IqrfNetModule\Exceptions\EmptyResponseException
\Nette\Utils\JsonException
\App\IqrfNetModule\Exceptions\UserErrorException

Returns

array —

API request and response

getPower()

getPower(int  $address, \App\IqrfNetModule\Entities\StandardLight[]  $lights) : array

Gets power of the lights

Parameters

int $address

Network device address

\App\IqrfNetModule\Entities\StandardLight[] $lights

Array of IQRF Standard light entities

Throws

\App\IqrfNetModule\Exceptions\DpaErrorException
\App\IqrfNetModule\Exceptions\EmptyResponseException
\Nette\Utils\JsonException
\App\IqrfNetModule\Exceptions\UserErrorException

Returns

array —

API request and response

setPower()

setPower(int  $address, \App\IqrfNetModule\Entities\StandardLight[]  $lights) : array

Sets a power of the lights

Parameters

int $address

Network device address

\App\IqrfNetModule\Entities\StandardLight[] $lights

Array of IQRF Standard light entities

Throws

\App\IqrfNetModule\Exceptions\DpaErrorException
\App\IqrfNetModule\Exceptions\EmptyResponseException
\Nette\Utils\JsonException
\App\IqrfNetModule\Exceptions\UserErrorException

Returns

array —

API request and response

incrementPower()

incrementPower(int  $address, \App\IqrfNetModule\Entities\StandardLight[]  $lights) : array

Increments power of the lights

Parameters

int $address

Network device address

\App\IqrfNetModule\Entities\StandardLight[] $lights

Array of IQRF Standard light entities

Throws

\App\IqrfNetModule\Exceptions\DpaErrorException
\App\IqrfNetModule\Exceptions\EmptyResponseException
\Nette\Utils\JsonException
\App\IqrfNetModule\Exceptions\UserErrorException

Returns

array —

API request and response

decrementPower()

decrementPower(int  $address, \App\IqrfNetModule\Entities\StandardLight[]  $lights) : array

Decrements power of the lights

Parameters

int $address

Network device address

\App\IqrfNetModule\Entities\StandardLight[] $lights

Array of IQRF Standard light entities

Throws

\App\IqrfNetModule\Exceptions\DpaErrorException
\App\IqrfNetModule\Exceptions\EmptyResponseException
\Nette\Utils\JsonException
\App\IqrfNetModule\Exceptions\UserErrorException

Returns

array —

API request and response

convertEntityToArray()

convertEntityToArray(array  $request, \App\IqrfNetModule\Entities\StandardLight[]  $lights) : void

Converts IQRF Standard light entities to arrays

Parameters

array $request

API request

\App\IqrfNetModule\Entities\StandardLight[] $lights

Array of IQRF Standard light entities