acte/data-report-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

acte/data-report-sdk

Composer 安装命令:

composer require acte/data-report-sdk

包简介

Connect to ACTE Technology data reporting API

README 文档

README

  • Collect your data via ACTE Technology secured gateway

Installation

Install with composer:

composer require acte/data-report-sdk

Configuration

  • Contact ACTE support in order to receive username, password and authorized databases
  • copy below code and edit configuration variables

Example

<?php
use ReportSdk\Connector;

// Configuration variables
$base_url = "https://example.com";
$username = "YOUR_USERNAME";
$password = "YOUR_PASSWORD";
$db = "DATA_DB"; # database

// init api class and connect
$api = new Connector($base_url);
$api->connect($username, $password);

// Check if the connection is successful
if ($api->check_connection()) {
    echo "Connected successfully.\n";
}

// get allowed databases
$databases = $api->getDatabases();
print_r($databases);
$db = $databases[0];

// get devices
$devices = $api->getDevices($db);
print_r($devices);
$device = $devices[0];

// get keys from device
$keys = $api->getKeys($db, $device);
print_r($keys);
$key = $keys[0];


// get telemetry data
//  prepare configuration parameters
date_default_timezone_set('UTC'); // Set the timezone to UTC
$to_ts = strtotime(date("Y-m-d", time()));
$from_ts = strtotime(date("Y-m-d", strtotime("-7 days")));

// TO DO:::
// $agg_type = "SUM"; // aggregation method: AVG | MIN | MAX | SUM
// $agg_interval = 3600; // aggregation interval in seconds

$data = $api->getTelemetry($db, $device, $key, $from_ts, $to_ts);
print_r($data);

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2024-06-08