Pilight receive match fix for bug 4637 (#4639)
* Pilight: dont protocol as list in COMMAND_SCHEMA As described in bug #4637 the protocol should not be wrapped in a list in the spec of COMMAND_SCHEMA because this causes the component to never successfully match any received rf code. As pointed ot in PR #4639 the easiest way to do this, is to not derive COMMAND_SCHEMA from RF_CODE_SCHEMA and specify protocol as simple string there. This fixes bug #4637. Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de> * Pilight: Add "unitcode" to command schema. This adds "unitcode" to the COMMAND_SCHEMA. It is used for example in the brennenstuhl protocol of pilight. Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>pull/4831/head
parent
c90a1b9760
commit
f78246e686
|
@ -11,7 +11,8 @@ import voluptuous as vol
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.components.pilight as pilight
|
||||
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
|
||||
from homeassistant.const import (CONF_NAME, CONF_ID, CONF_SWITCHES, CONF_STATE)
|
||||
from homeassistant.const import (CONF_NAME, CONF_ID, CONF_SWITCHES, CONF_STATE,
|
||||
CONF_PROTOCOL)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -21,13 +22,16 @@ CONF_ON_CODE = 'on_code'
|
|||
CONF_ON_CODE_RECIEVE = 'on_code_receive'
|
||||
CONF_SYSTEMCODE = 'systemcode'
|
||||
CONF_UNIT = 'unit'
|
||||
CONF_UNITCODE = 'unitcode'
|
||||
|
||||
DEPENDENCIES = ['pilight']
|
||||
|
||||
COMMAND_SCHEMA = pilight.RF_CODE_SCHEMA.extend({
|
||||
COMMAND_SCHEMA = vol.Schema({
|
||||
vol.Optional(CONF_PROTOCOL): cv.string,
|
||||
vol.Optional('on'): cv.positive_int,
|
||||
vol.Optional('off'): cv.positive_int,
|
||||
vol.Optional(CONF_UNIT): cv.positive_int,
|
||||
vol.Optional(CONF_UNITCODE): cv.positive_int,
|
||||
vol.Optional(CONF_ID): cv.positive_int,
|
||||
vol.Optional(CONF_STATE): cv.string,
|
||||
vol.Optional(CONF_SYSTEMCODE): cv.positive_int,
|
||||
|
|
Loading…
Reference in New Issue