Skip to content
Browse files

GitHub #46 - Updating documentation

  • Loading branch information...
1 parent 8169c74 commit 12a9a9e650c29c3049cfb363ca7a6e3a1514f7c4 @sqmk committed
Showing with 19 additions and 28 deletions.
  1. +19 −28 README.md
View
47 README.md
@@ -74,7 +74,7 @@ try {
All commands can be issued in a similar manner as the previous two examples.
-Once you have determined you can make requests to the bridge, you can test if the username you provided is authenticated.
+Once you have determined you can make requests to the bridge, you can test if the username you provided is available.
```php
$isAuthenticated = $client->sendCommand(
@@ -86,22 +86,22 @@ echo $isAuthenticated
: 'You are not authenticated!';
```
-If the username provided is not authenticated, you can use the convenience script to authenticate, which is documented later in this README. Or, you can use the Authenticate command to do it yourself.
+If the username provided is not created, you can use the convenience script to authenticate, which is documented later in this README. Or, you can use the CreateUser command to do it yourself.
```php
// Push the bridge's link button prior to running this
try {
$client->sendCommand(
- new \Phue\Command\Authenticate
+ new \Phue\Command\CreateUser($client->getUsername())
);
- echo "{$client->getUsername()} is now authenticated";
+ echo "You are now authenticated";
} catch (\Phue\Transport\Exception\LinkButtonException $e) {
echo 'The link button was not pressed!';
}
```
-After the user is authenticated, you won't have to authenticate again unless you reset the bridge!
+After the user is created, you won't have to create it again unless you reset the bridge!
### Managing lights
@@ -463,48 +463,39 @@ The internal IP address(es) listed in the results is what you need for the Phue
If the script provided doesn't find your bridge, or if you don't have internet connection on your network, I have created a wiki page that describes a few other convenient ways of finding it: [Finding Philips Hue bridge on network](/sqmk/Phue/wiki/Finding-Philips-Hue-bridge-on-network).
-### Authentication
+### Authentication / Creating a User
-To test connectivity and authenticate with the bridge, you can use ```bin/phue-authenticate```. The script uses the Phue library to make requests and receive responses from the Philips Hue bridge.
+To test connectivity and authenticate with the bridge, you can use ```bin/phue-create-user```. The script uses the Phue library to make requests and receive responses from the Philips Hue bridge.
-At this point, you should be ready to authenticate with the bridge. The bridge expects a 32 character hash as a username to authenticate with, but you can feed in any string into the client and it will automatically hash for you. This is much easier to remember than the hash!
+At this point, you should be ready to authenticate with the bridge. The bridge expects a username between 10 and 40 characters with alphanumeric characters to authenticate with.
-Here's how to run the script for authenticating:
+Here's how to run the script for authenticating/creating a user:
```
-$ ./bin/phue-authenticate 10.0.1.31 your.username
+$ ./bin/phue-create-user 10.0.1.31 your.username
```
If the connection is ok, you will get a response similar to this:
```
-! - Username your.username doesn't appear to be 32 character hash (A-F, 0-9)
-! - Using this for username instead: af8caecf12655838d10fa92d86d09e82
-
Testing connection to bridge at 10.0.1.31
-Response appears OK!
-
-Attempting to authenticate (af8caecf12655838d10fa92d86d09e82):
+Attempting to create user:
Press the Bridge's button!
-Waiting.....
+Waiting.........
```
-The ```phue-authenticate``` script will attempt to authenticate with the bridge once every second. The bridge's connection button (the big round lit up one) needs to be pressed while the script runs. If the button is pressed during execution of the script, you should get a response like this:
+The ```phue-create-user``` script will attempt to create a user on the bridge once every second. The bridge's connection button (the big round lit up one) needs to be pressed while the script runs. If the button is pressed during execution of the script, you should get a response like this:
```
-! - Username your.username doesn't appear to be 32 character hash (A-F, 0-9)
-! - Using this for username instead: af8caecf12655838d10fa92d86d09e82
-
Testing connection to bridge at 10.0.1.31
-Response appears OK!
-
-Attempting to authenticate (af8caecf12655838d10fa92d86d09e82):
+Attempting to create user:
Press the Bridge's button!
-Waiting......
-Authentication for user your.username was successful!
+Waiting..........
+
+Successfully created new user: whateverok
```
-From then on, you should be able to use the final username for interacting with the Philips Hue bridge!
+From then on, you should be able to use the username you just created for interacting with the Philips Hue bridge!
### Scanning / registering new lights
@@ -512,7 +503,7 @@ Now that you have tested connection and authentication to the bridge, you can no
Another convenience script has been created to demonstrate how to use Phue to get the bridge to start scanning for and retrieving new lights. This script is ```phue-light-finder```, and it is also located in the ```bin``` directory.
-You can pass the same arguments for ```phue-light-finder``` as you did with ```phue-authenticate```. Here's how to use the script:
+You can pass the same arguments for ```phue-light-finder``` as you did with ```phue-create-user```. Here's how to use the script:
```
$ ./bin/phue-light-finder 10.0.1.31 your.username

0 comments on commit 12a9a9e

Please sign in to comment.
Something went wrong with that request. Please try again.