$mains
$mains : bool
PowerSupply metadata entity
$accumulator : \Iqrf\Repository\Entities\Metadata\Accumulator
$battery : \Iqrf\Repository\Entities\Metadata\Battery
$external : ?\Iqrf\Repository\Entities\Metadata\External
__construct(bool $mains, \Iqrf\Repository\Entities\Metadata\Accumulator $accumulator, \Iqrf\Repository\Entities\Metadata\Battery $battery, float $minVoltage, \Iqrf\Repository\Entities\Metadata\External|null $external = null) : mixed
Constructs PowerSupply metadata object.
| bool | $mains | Power supplied by a main cable. |
| \Iqrf\Repository\Entities\Metadata\Accumulator | $accumulator | Accumulator power supply spec. |
| \Iqrf\Repository\Entities\Metadata\Battery | $battery | Battery power supply spec. |
| float | $minVoltage | Minimum voltage (in V) required for operation. |
| \Iqrf\Repository\Entities\Metadata\External|null | $external | External power properties. |
fromApiResponseV0(array{mains: bool, accumulator: array{present: bool, type: string|null, lowLevel: float|null}, battery: array{present: bool, type: string|null, changeThreshold: float|null}, minVoltage: float} $response) : \Iqrf\Repository\Entities\Metadata\PowerSupply
Parses the provided array into a PowerSupply object (Version 0).
| array{mains: bool, accumulator: array{present: bool, type: string|null, lowLevel: float|null}, battery: array{present: bool, type: string|null, changeThreshold: float|null}, minVoltage: float} | $response | API response body |
Thrown if required properties are missing
The parsed PowerSupply object
fromApiResponseV1(array{mains: bool, accumulator: array{present: bool, type: string|null, lowLevel: float|null}, battery: array{present: bool, type: string|null, changeThreshold: float|null}, minVoltage: float, external?: array{type?: string, nominalVoltage?: float, minVoltage?: float, maxVoltage?: float}} $response) : \Iqrf\Repository\Entities\Metadata\PowerSupply
Parses the provided array into a PowerSupply object (Version 1).
| array{mains: bool, accumulator: array{present: bool, type: string|null, lowLevel: float|null}, battery: array{present: bool, type: string|null, changeThreshold: float|null}, minVoltage: float, external?: array{type?: string, nominalVoltage?: float, minVoltage?: float, maxVoltage?: float}} | $response | API response body |
Thrown if required properties are missing
The parsed PowerSupply object
jsonSerialize() : array{mains: bool, accumulator: array{present: bool, type: string|null, lowLevel: float|null}, battery: array{present: bool, type: string|null, changeThreshold: float|null}, minVoltage: float, external?: array{type?: string, nominalVoltage?: float, minVoltage?: float, maxVoltage?: float}}
Serializes PowerSupply entity into JSON
JSON-serialized PowerSupply entity