byd/api-client
Composer 安装命令:
composer require byd/api-client
包简介
PHP client for BYD vehicle API
README 文档
README
PHP client library for the BYD vehicle API.
Features
- Authentication
- Vehicle listing
- Real-time data
- GPS information
- HVAC status
- Charging status
- Energy consumption
- Remote control
- Smart charging
- Push notifications
- Vehicle settings
Installation
composer require byd/api-client
Usage
<?php require_once 'vendor/autoload.php'; use Byd\ApiClient\Client; use Byd\ApiClient\Config\BydConfig; // Create configuration $config = BydConfig::fromEnv([ 'username' => 'your-email@example.com', 'password' => 'your-password', // ... other options ]); // Create client $client = new Client($config); // Login $client->login(); // Get vehicles $vehicles = $client->getVehicles(); foreach ($vehicles as $vehicle) { echo "VIN: " . $vehicle->getVin() . "\n"; echo "Model: " . $vehicle->getModelName() . "\n"; echo "---\n"; }
Configuration
The client can be configured in several ways:
Environment Variables
BYD_USERNAME=your-email@example.com BYD_PASSWORD=your-password BYD_BASE_URL=https://dilinkappoversea-eu.byd.auto BYD_COUNTRY_CODE=NL BYD_LANGUAGE=en BYD_TIME_ZONE=Europe/Amsterdam
Direct Configuration
$config = new BydConfig( 'your-email@example.com', 'your-password', 'https://dilinkappoversea-eu.byd.auto', // base URL 'NL', // country code 'en', // language 'Europe/Amsterdam', // time zone // ... other options );
API Documentation
Key classes and methods:
Client- Main client classBydConfig- Configuration classVehicle- Vehicle modelVehicleApi- Vehicle-related API methodsRealtimeApi- Real-time data API methodsGpsApi- GPS information API methodsHvacApi- HVAC status API methodsChargingApi- Charging status API methodsEnergyApi- Energy consumption API methodsControlApi- Remote control API methodsSmartChargingApi- Smart charging API methodsPushNotificationsApi- Push notifications API methodsVehicleSettingsApi- Vehicle settings API methods
Requirements
- PHP 8.1+
- ext-json
- guzzlehttp/guzzle ^7.0
- psr/log ^3.0
Development
Install dependencies
composer install
Run tests
composer test
Code style
composer cs-fix
License
This project is licensed under the MIT License - see the LICENSE file for details.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-08