PHP code example of besmartand-pro / bsap-sensor-client

1. Go to this page and download the library: Download besmartand-pro/bsap-sensor-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

besmartand-pro / bsap-sensor-client example snippets


use BeSmartAndPro\BsapSensorClient\SensorClient;
use GuzzleHttp\Client;
use Nyholm\Psr7\Factory\Psr17Factory;

,
    $_ENV['SENSOR_API_TOKEN'],
);

foreach ($client->getSensorHistory('SENSOR_UUID') as $measurement) {
    echo $measurement->getSensor() . ': ' . $measurement->getTemperature() . PHP_EOL;
}