on/off/toggle methods for custom device types

Posted on
Thu Jan 06, 2022 6:17 pm
LSpad offline
Posts: 30
Joined: Oct 01, 2018

on/off/toggle methods for custom device types

Is there any workaround to allow on/off/toggle methods for a custom device? I know custom devices inherent from the device base class, and my understanding is that this lacks the necessary properties to allow the use of indigo.device.turnOn(123), indigo.device.turnOff(123), and indigo.device.toggle(123) API commands?

I’m looking for a way to execute some code via on/off/toggle for virtual AV devices, where an on command would start a default source playing. Not sure if this is possible?

Posted on
Thu Jan 06, 2022 6:35 pm
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Re: on/off/toggle methods for custom device types

You can implement an indigo.RelayDevice instead of a indigo.Device - you can still add states, etc, but it will allow your device to receive on/off/toggle actions.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests