dutchie027/govee-api-v2
Composer 安装命令:
composer require dutchie027/govee-api-v2
包简介
API Using Govee's newer OpenAPI Spec
README 文档
README
Govee PHP API v2
This is a rewrite of the Govee API I wrote a while back. Govee changed the API to be more robust, so I am rewriting the code to accommodate.
WORK IN PROGRESS
NOTE: This is still a work in progress. As I commit more to it, it will become more stable, but for now it's not fully baked.
Requirements
- PHP >8
Installation
You can install the package using the Composer package manager. You can install it by running this command in your project root:
composer require dutchie027/govee-api-v2
Basic Usage
Set up the Environment Variables
Rename .env.sample to .env and set the variables accordingly.
Instantiate the client
To use any of the Govee API functions, you first need a connection reference. The connection refrence can then be fed to either the Lights library or the Plugs library, or even both if you have both Govee Lights and Plugs.
Using the full name:
// Ensure we have the composer libraries require_once ('vendor/autoload.php'); // Instantiate & Connect $govee = new dutchie027\GoveeApiV2\Connect();
Using a namespace:
// Ensure we have the composer libraries require_once ('vendor/autoload.php'); // Namespace use dutchie027\GoveeApiV2\Connect; // Instantiate with defaults $govee = new Connect();
Get Device Count
print $govee->getDeviceCount();
Get All Devices
$array = $govee->getDeviceList();
NOTE: This function takes a boolean parameter. If the parameter is set to true it will return an array based on the Govee API. If it's set to false, it returns raw JSON.
Get An Array of All Callable MAC Addresses
$macArray = $govee->getDeviceMACArray();
MAC Return Array
Array ( [0] => A9:E9:0A:04:AD:CD:12:34 [1] => FA:8F:50:B2:AD:A7:00:12 [2] => E0:94:41:AC:62:13:56:78 )
Get An Array of All Device Names
$nameArray = $govee->getDeviceNameArray();
Device Name Return Array
Array ( [0] => My-Living-Room [1] => Hallway [2] => Fire-House )
Contributing
If you're having problems, spot a bug, or have a feature suggestion, file an issue. If you want, feel free to fork the package and make a pull request. This is a work in progresss as I get more info and the Govee API grows.
dutchie027/govee-api-v2 适用场景与选型建议
dutchie027/govee-api-v2 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 252 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 12 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「control」 「home automation」 「lights」 「plugs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dutchie027/govee-api-v2 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dutchie027/govee-api-v2 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dutchie027/govee-api-v2 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Provide a way to secure accesses to all routes of an symfony application.
A PSR-7 compatible library for making CRUD API endpoints
Yii2 prettyPhoto image galary widget uses Lightbox view control jquery.prettyphoto.js
Yii2 DynaTree Menu widget uses Dynamic tree view control jquery.dynatree.js
ServerPilot: the best way to run PHP websites.
General Interface for access control
统计信息
- 总下载量: 252
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-29