Added a Dimmer type device:
https://github.com/FlyingDiver/Indigo-M ... e/releasesThis one is a little more involved to set up, because it's two way. The Sensor device just watches a specified state in the underlying device, and sets the onOffState of the masquerade device appropriately.
For the dimmer device, in addition to knowing the target device state that contains the value you're trying to masquerade, you also need an available action in the underlying device that will set that state. And you need to know the ConfigUI Field used by that action. For example, if you wanted to masquerade an Airfoil Speaker's volume setting as a dimmer device, so it could be commanded from Siri or Alexa, you would look at the Actions.xml file inside the Airfoil Pro plugin. In there, you would see:
- Code: Select all
<Action id="setVolume" deviceFilter="self.speaker" uiPath="DeviceActions">
<Name>Set Volume</Name>
<CallbackMethod>setVolume</CallbackMethod>
<ConfigUI>
<Field id="volume" type="textfield" defaultValue="50">
<Label>Enter New Volume:</Label>
<Description>Enter a value from 0 to 100</Description>
</Field>
<Field id="description" type="textfield" hidden="true">
<Label></Label>
</Field>
</ConfigUI>
</Action>
So the Action needed is "setVolume", and the Field used to pass the new setting is "volume". When you go to set these in the Masquerade plugin's device configuration dialog, it'll actually show the Name field for the action - "Set Volume". The Field section doesn't have a name, so it shows the "id".
Attached is the screen shot of the device configuration dialog for an Airfoil Pro speaker.