You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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
Copy file name to clipboardExpand all lines: docs/hands-on-lab/01-installing-prereqs.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ To start, install Puppet Development Kit (PDK), which provides all the necessary
4
4
5
5
1.[Download PDK](https://puppet.com/download-puppet-development-kit) on your platform of choice.
6
6
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.
8
8
9
9
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.
Copy file name to clipboardExpand all lines: docs/hands-on-lab/02-connecting-to-the-lightbulbs.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,7 @@ There are no technical restrictions on the kinds of remote devices or APIs you c
4
4
5
5
## Hue Emulator
6
6
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:
Copy file name to clipboardExpand all lines: docs/hands-on-lab/04-adding-a-new-transport.md
+16-12Lines changed: 16 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,9 @@
1
1
# Add a new transport
2
2
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:
4
4
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:
15
7
16
8
```
17
9
david@davids:~/tmp/hue$ pdk update --force
@@ -34,6 +26,18 @@ You can find a report of differences in update_report.txt.
34
26
david@davids:~/tmp/hue$
35
27
```
36
28
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
+
37
41
## Checkpoint
38
42
39
43
To validate your new module and transport, run `pdk validate --parallel` and `pdk test unit`:
@@ -62,7 +66,7 @@ Run options: exclude {:bolt=>true}
62
66
david@davids:~/tmp/hue$
63
67
```
64
68
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:
0 commit comments