PHP code example of dutchie027 / govee-api-v2

1. Go to this page and download the library: Download dutchie027/govee-api-v2 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/ */

    

dutchie027 / govee-api-v2 example snippets


// Ensure we have the composer libraries
utchie027\GoveeApiV2\Connect();

// Ensure we have the composer libraries
Connect;

// Instantiate with defaults
$govee = new Connect();

print $govee->getDeviceCount();

$array = $govee->getDeviceList();

$macArray = $govee->getDeviceMACArray();

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
)

$nameArray = $govee->getDeviceNameArray();

Array
(
    [0] => My-Living-Room
    [1] => Hallway
    [2] => Fire-House
)