\Iqrf\Repository\Entities\Metadata Battery

Battery metadata entity

Summary

Methods
Properties
Constants
__construct
fromApiResponseV0
fromApiResponseV1
jsonSerialize
present
type
changeThreshold
conditioning
No public constants found
No protected methods found
No protected properties found
No protected constants found
No private methods found
No private properties found
No private constants found

Properties

$present

$present : bool

Type

bool

$type

$type : ?string

Type

string|null

$changeThreshold

$changeThreshold : ?float

Type

float|null

$conditioning

$conditioning : ?bool

Type

bool|null

Methods

__construct()

__construct(bool  $present, string|null  $type = null, float|null  $changeThreshold = null, bool|null  $conditioning = null) : mixed

Constructs Battery metadata object.

Parameters

bool $present

Power supplied from a battery.

string|null $type

Battery type identifier.

float|null $changeThreshold

Voltage (in V) threshold indicating a change of battery is recommended.

bool|null $conditioning

Product periodically takes action to extend lifespan of battery.

Returns

mixed —

fromApiResponseV0()

fromApiResponseV0(array{present: bool, type: string|null, changeThreshold: float|null}  $response) : \Iqrf\Repository\Entities\Metadata\Battery

Parses the provided response data into a Battery object (Version 0).

Parameters

array{present: bool, type: string|null, changeThreshold: float|null} $response

API response body

Throws

\InvalidArgumentException

Thrown if required properties are missing

Returns

\Iqrf\Repository\Entities\Metadata\Battery —

The parsed Battery object

fromApiResponseV1()

fromApiResponseV1(array{present: bool, type: string|null, changeThreshold: float|null, conditioning?: bool}  $response) : \Iqrf\Repository\Entities\Metadata\Battery

Parses the provided array into a Battery object (Version 1).

Parameters

array{present: bool, type: string|null, changeThreshold: float|null, conditioning?: bool} $response

API response body

Throws

\InvalidArgumentException

Thrown if required properties are missing

Returns

\Iqrf\Repository\Entities\Metadata\Battery —

The parsed Battery object

jsonSerialize()

jsonSerialize() : array{present: bool, type: string|null, changeThreshold: float|null, conditioning?: bool}

Returns

array{present: bool, type: string|null, changeThreshold: float|null, conditioning?: bool} —

JSON-serialized Battery entity