<commit_before>### Alexa Cookbook
## Controlling Screens - Install IOT Skill <a id="title"></a>
<hr />

### Intro
Install the State Pop skill, which will update the IOT Device Shadow on each request.


#### Cloudformation
Use the following Cloud Formation URL to create the necessary AWS Resources.

 + https://s3.amazonaws.com/alexabucket7/cloudformation/statepop.json


<commit_msg>Alexa Cookbook updates<commit_after>### Alexa Cookbook
## Controlling Screens - Install IOT Skill <a id="title"></a>
<hr />

### Intro
Install the State Pop skill, which will update the IOT Device Shadow on each request.


#### Skill Lambda code

Your skill can add helper functions such as the one listed in this Gist, to update the state of your IOT Thing.

https://gist.github.com/robm26/abe437c9938a95f0eeb5f83cc0dffb8d

A handler in your main index.js file can call this function with three key data structures from your Alexa request.

```
var config = {};  // AWS settings to be added
var Intent = {};
if (this.event.request.type == "IntentRequest") {
    Intent = this.event.request.intent;
} else {
    Intent = {"name" : this.event.request.type };
}

var pload = {
    "intent" : Intent,
    "attributes" : this.event.session.attributes,
    "say" : speechOutput
};

setShadow(pload, config, (status) => {
                console.log("set shadow and status is " + status);
                this.emit(':ask', say);
            }


```

{'fraction_non_alphanumeric': 0.11632796075683252, 'fraction_numerical': 0.013314646110721794, 'mean_word_length': 3.504731861198738, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5882599', 'n_tokens_mistral': 444, 'n_tokens_neox': 423, 'n_words': 153}