Skip to content

Commit 71a8e0b

Browse files
committed
(FM-8079) Final touches
* clarify that, yes, bulbs are needed, too * remove duplicate java and emulator install instructions * update "Add a new transport" section to use released pdk feature
1 parent 57901ea commit 71a8e0b

File tree

8 files changed

+18
-159
lines changed

8 files changed

+18
-159
lines changed

docs/hands-on-lab/01-installing-prereqs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ To start, install Puppet Development Kit (PDK), which provides all the necessary
44

55
1. [Download PDK](https://puppet.com/download-puppet-development-kit) on your platform of choice.
66

7-
2. If you do not have a Philips HUE hub available, you can download the [Hue-Emulator](https://github.com/SteveyO/Hue-Emulator/raw/master/HueEmulator-v0.8.jar). You need to have Java installed to run this.
7+
2. If you do not have a Philips HUE hub and bulbs available, you can download the [Hue-Emulator](https://github.com/SteveyO/Hue-Emulator/raw/master/HueEmulator-v0.8.jar). You need to have Java installed to run this.
88

99
3. To edit code, we recommend the cross-platform editor [VSCode](https://code.visualstudio.com/download), with the [Ruby](https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby) and [Puppet](https://marketplace.visualstudio.com/items?itemName=jpogran.puppet-vscode) extensions. There are lots of other extensions that can help you with your development workflow.
1010

docs/hands-on-lab/02-connecting-to-the-lightbulbs.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ There are no technical restrictions on the kinds of remote devices or APIs you c
44

55
## Hue Emulator
66

7-
Download the [HueEmulator-v0.8.jar](https://github.com/SteveyO/Hue-Emulator/blob/master/HueEmulator-v0.8.jar) from [SteveyO/Hue-Emulator](https://github.com/SteveyO/Hue-Emulator).
8-
9-
To run the Hue Emulator, you need to have a Java Runtime installed. Use `java -jar` with the emulator's filename to run it, for example:
7+
Use `java -jar` with the emulator's filename to run it, for example:
108

119
```
1210
david@davids:~$ java -jar ~/Downloads/HueEmulator-v0.8.jar

docs/hands-on-lab/04-adding-a-new-transport.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
# Add a new transport
22

3-
[Eventually](https://github.com/puppetlabs/pdk/pull/666) there will be a `pdk new transport` command. For now, you'll need to copy the files below.
3+
Starting with PDK 1.12.0 there is the `pdk new transport` command, that you can use to create the base files for your new transport:
44

5-
Copy the files from [this directory](./04-adding-a-new-transport/) into your new module:
6-
7-
* .sync.yml
8-
* lib/puppet/transport/hue.rb
9-
* lib/puppet/transport/schema/hue.rb
10-
* lib/puppet/util/network_device/hue/device.rb
11-
* spec/unit/puppet/transport/hue_spec.rb
12-
* spec/unit/puppet/transport/schema/hue_spec.rb
13-
14-
Run `pdk update --force` to enable a few future defaults that are required for these templates:
5+
Copy the [.sync.yml](./04-adding-a-new-transport/.sync.yml) into your new module, and run `pdk update --force` to enable a few future
6+
defaults that are required for this command:
157

168
```
179
david@davids:~/tmp/hue$ pdk update --force
@@ -34,6 +26,18 @@ You can find a report of differences in update_report.txt.
3426
david@davids:~/tmp/hue$
3527
```
3628

29+
Then, create the actual transport:
30+
31+
```
32+
david@davids:~/tmp/hue$ pdk new transport hue
33+
pdk (INFO): Creating '/home/david/tmp/hue/lib/puppet/transport/hue.rb' from template.
34+
pdk (INFO): Creating '/home/david/tmp/hue/lib/puppet/transport/schema/hue.rb' from template.
35+
pdk (INFO): Creating '/home/david/tmp/hue/lib/puppet/util/network_device/hue/device.rb' from template.
36+
pdk (INFO): Creating '/home/david/tmp/hue/spec/unit/puppet/transport/hue_spec.rb' from template.
37+
pdk (INFO): Creating '/home/david/tmp/hue/spec/unit/puppet/transport/schema/hue_spec.rb' from template.
38+
david@davids:~/tmp/hue$
39+
```
40+
3741
## Checkpoint
3842

3943
To validate your new module and transport, run `pdk validate --parallel` and `pdk test unit`:
@@ -62,7 +66,7 @@ Run options: exclude {:bolt=>true}
6266
david@davids:~/tmp/hue$
6367
```
6468

65-
If you're working with a version control system, now would be a good time to make your first commit and store the boilerplate code, and then you can revisit the changes you made later. For example:
69+
If you're working with a version control system, now would be a good time to make your first commit and store the boilerplate code, and then you can revisit the changes you made later. For example:
6670

6771
```
6872
david@davids:~/tmp/hue$ git init

docs/hands-on-lab/04-adding-a-new-transport/lib/puppet/transport/hue.rb

Lines changed: 0 additions & 36 deletions
This file was deleted.

docs/hands-on-lab/04-adding-a-new-transport/lib/puppet/transport/schema/hue.rb

Lines changed: 0 additions & 28 deletions
This file was deleted.

docs/hands-on-lab/04-adding-a-new-transport/lib/puppet/util/network_device/hue/device.rb

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/hands-on-lab/04-adding-a-new-transport/spec/unit/puppet/transport/hue_spec.rb

Lines changed: 0 additions & 56 deletions
This file was deleted.

docs/hands-on-lab/04-adding-a-new-transport/spec/unit/puppet/transport/schema/hue_spec.rb

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)