<H1>STREAM DECK plugin for Yoctopuce devices</H1>

This is a plugin for [Elgato's STREAM DECK](https://www.elgato.com/en) devices allowing to control 
some Yoctopuce devices. 

![decoration](https://www.yoctopuce.com/pubarchive/2023-03/StreamDeckAndYoctopuce_1.jpg)

Supported Yoctopuce features are:

- Relay (Yocto-Relay, Yocto-PowerRelay, Yocto-MaxiPowerRelay etc...)
- CurrentLoopOutput (Yocto-4-20mA-tx)
- VoltageOutput (Yocto-0-10v-tx)
- WakeupMonitor (Yoctohub-Wireless, YoctoHub-GSM)
- Servo (Yocto-Servo)
- Buzzer (Yocto-Buzzer, Yocto-Maxi-Buzzer)
- ColorLedCluster (Yocto-Color-V2, Yocto-Maxi-Buzzer, Yocto-Maxi-Knob)

<h2> Project structure</h2> 
You are supposed to copy  the *code* folder contents to *%appdata%\Elgato\StreamDeck\Plugins\*. Anyway, it might be wiser to unzip the  project  structure whereever you want, then create in the appdata folder a  symlink named *com.yoctopuce.modules.sdPlugin* pointing to the matching folder in Dist. 


<h2> How to compile</h2> 
Make sure you have [node.js](https://nodejs.org/) installed. 

Place yourself in the top folder, 

type <code>npm install</code> (you only have to do it once).

then type  <code>npm run build</code> to compile the plugin

All required files will end up in the dist/com.yoctopuce.modules.sdPlugin folder.

if [DistributionTool.exe](https://developer.elgato.com/documentation/stream-deck/sdk/packaging/) from elgato is available in the bin folder, then it will be automatically used to bundle to plugin which will be available in the dist/Release folder


<h2> How to ceate a new action</h2> 
Just use one existing action as a base. If  you just Need an ON/OFF feature, use the Relay version. If you need a "analog" feature compatible with the SD+ encoder, use the CurrentLoopOutput

IMPORTANT:  pay extra attention to  upper / lower case for Yoctopuce related stuff in import/class/functions names.
   
1. Make a copy of the  src/relay or the src/currentLoopOutput folder
2. Rename all files with the Yoctopuce function name
2. Edit both xx_pi and xx_action icons in artwork sub folder 
3. Edit src/xx_pi.html, src/xx_pi.ts, src/xx_plugin.ts, src/xx_settings.ts  
4. Add an entry in  file yocto_SD_plugin.ts
5. Add an entry in  manifest.ts
6. And an entry the the file build/build.ts (search for fcttypes array)




   
    