mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Add respond_to_read option to KNX switch (#51790)
This commit is contained in:
parent
89cdda9fe6
commit
253310aaa4
@ -716,6 +716,7 @@ class SwitchSchema(KNXPlatformSchema):
|
|||||||
{
|
{
|
||||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||||
vol.Optional(CONF_INVERT, default=False): cv.boolean,
|
vol.Optional(CONF_INVERT, default=False): cv.boolean,
|
||||||
|
vol.Optional(CONF_RESPOND_TO_READ, default=False): cv.boolean,
|
||||||
vol.Required(KNX_ADDRESS): ga_list_validator,
|
vol.Required(KNX_ADDRESS): ga_list_validator,
|
||||||
vol.Optional(CONF_STATE_ADDRESS): ga_list_validator,
|
vol.Optional(CONF_STATE_ADDRESS): ga_list_validator,
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
|||||||
from homeassistant.helpers.restore_state import RestoreEntity
|
from homeassistant.helpers.restore_state import RestoreEntity
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
from .const import DOMAIN, KNX_ADDRESS
|
from .const import CONF_RESPOND_TO_READ, DOMAIN, KNX_ADDRESS
|
||||||
from .knx_entity import KnxEntity
|
from .knx_entity import KnxEntity
|
||||||
from .schema import SwitchSchema
|
from .schema import SwitchSchema
|
||||||
|
|
||||||
@ -48,6 +48,7 @@ class KNXSwitch(KnxEntity, SwitchEntity, RestoreEntity):
|
|||||||
name=config[CONF_NAME],
|
name=config[CONF_NAME],
|
||||||
group_address=config[KNX_ADDRESS],
|
group_address=config[KNX_ADDRESS],
|
||||||
group_address_state=config.get(SwitchSchema.CONF_STATE_ADDRESS),
|
group_address_state=config.get(SwitchSchema.CONF_STATE_ADDRESS),
|
||||||
|
respond_to_read=config[CONF_RESPOND_TO_READ],
|
||||||
invert=config[SwitchSchema.CONF_INVERT],
|
invert=config[SwitchSchema.CONF_INVERT],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user