-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
23 changed files
with
1,332 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
vendor/art-of-wifi/unifi-api-client/examples/ap_upgrade_firmware.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* PHP API usage example | ||
* | ||
* contributed by: @4oo4 | ||
* description: example script to check and upgrade device firmware (can be scheduled with systemd/cron) | ||
* to the most current version | ||
*/ | ||
require_once('vendor/autoload.php'); | ||
require_once('config.php'); | ||
|
||
/** | ||
* site id of the AP to update | ||
*/ | ||
$site_id = '<enter your site id here>'; | ||
|
||
/** | ||
* device MAC address formatted with colons, e.g. 'de:ad:be:ef:01:23' | ||
*/ | ||
$device_mac = '<enter MAC address of device to update>'; | ||
|
||
/** | ||
* initialize the UniFi API connection class, log in to the controller | ||
* (this example assumes you have already assigned the correct values in config.php to the variables used) | ||
*/ | ||
$unifi_connection = new UniFi_API\Client($controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion, false); | ||
$login = $unifi_connection->login(); | ||
|
||
/** | ||
* Run the actual upgrade | ||
*/ | ||
$results = $unifi_connection->upgrade_device($device_mac); | ||
|
||
/** | ||
* provide feedback in json format from $response given by upgrade_device(); | ||
*/ | ||
echo json_encode($results, JSON_PRETTY_PRINT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.