I’m implementing a new platform. The platform has two different switches, with different properties and a different platform behaviour. Currently I have a single PLATFORM_SCHEMA
and a class class MyDevice(SwitchDevice)
into my switch.py
, which is coded accordingly to the param CONF_TYPE.
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Required(CONF_TYPE): cv.positive_int,
vol.Required(CONF_DIGITAL_JOIN_OUT_OFF): cv.positive_int,
vol.Required(CONF_DIGITAL_JOIN_IN_STATUS): cv.positive_int,
}
)
Is there a better/smarter way to do it?