How to use the xknx.devices.add function in xknx

To help you get started, we’ve selected a few xknx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github XKNX / xknx / home-assistant-plugin / custom_components / xknx / notify.py View on Github external
def async_get_service_config(hass, config):
    """Set up notification for KNX platform configured within platform."""
    import xknx

    notification = xknx.devices.Notification(
        hass.data[DATA_XKNX].xknx,
        name=config[CONF_NAME],
        group_address=config[CONF_ADDRESS],
    )
    hass.data[DATA_XKNX].xknx.devices.add(notification)
    return KNXNotificationService([notification])
github home-assistant / home-assistant / homeassistant / components / knx / climate.py View on Github external
CONF_TARGET_TEMPERATURE_STATE_ADDRESS
        ],
        group_address_setpoint_shift=config.get(CONF_SETPOINT_SHIFT_ADDRESS),
        group_address_setpoint_shift_state=config.get(
            CONF_SETPOINT_SHIFT_STATE_ADDRESS
        ),
        setpoint_shift_step=config[CONF_SETPOINT_SHIFT_STEP],
        setpoint_shift_max=config[CONF_SETPOINT_SHIFT_MAX],
        setpoint_shift_min=config[CONF_SETPOINT_SHIFT_MIN],
        group_address_on_off=config.get(CONF_ON_OFF_ADDRESS),
        group_address_on_off_state=config.get(CONF_ON_OFF_STATE_ADDRESS),
        min_temp=config.get(CONF_MIN_TEMP),
        max_temp=config.get(CONF_MAX_TEMP),
        mode=climate_mode,
    )
    hass.data[DATA_KNX].xknx.devices.add(climate)

    async_add_entities([KNXClimate(climate)])
github home-assistant / home-assistant / homeassistant / components / notify / knx.py View on Github external
def async_get_service_config(hass, config):
    """Set up notification for KNX platform configured within platform."""
    import xknx
    notification = xknx.devices.Notification(
        hass.data[DATA_KNX].xknx,
        name=config.get(CONF_NAME),
        group_address=config.get(CONF_ADDRESS))
    hass.data[DATA_KNX].xknx.devices.add(notification)
    return KNXNotificationService([notification, ])
github home-assistant / home-assistant / homeassistant / components / knx / light.py View on Github external
group_address_switch=config[CONF_ADDRESS],
        group_address_switch_state=config.get(CONF_STATE_ADDRESS),
        group_address_brightness=config.get(CONF_BRIGHTNESS_ADDRESS),
        group_address_brightness_state=config.get(CONF_BRIGHTNESS_STATE_ADDRESS),
        group_address_color=config.get(CONF_COLOR_ADDRESS),
        group_address_color_state=config.get(CONF_COLOR_STATE_ADDRESS),
        group_address_rgbw=config.get(CONF_RGBW_ADDRESS),
        group_address_rgbw_state=config.get(CONF_RGBW_STATE_ADDRESS),
        group_address_tunable_white=group_address_tunable_white,
        group_address_tunable_white_state=group_address_tunable_white_state,
        group_address_color_temperature=group_address_color_temp,
        group_address_color_temperature_state=group_address_color_temp_state,
        min_kelvin=config[CONF_MIN_KELVIN],
        max_kelvin=config[CONF_MAX_KELVIN],
    )
    hass.data[DATA_KNX].xknx.devices.add(light)
    async_add_entities([KNXLight(light)])
github home-assistant / home-assistant / homeassistant / components / switch / knx.py View on Github external
def async_add_entities_config(hass, config, async_add_entities):
    """Set up switch for KNX platform configured within platform."""
    import xknx
    switch = xknx.devices.Switch(
        hass.data[DATA_KNX].xknx,
        name=config.get(CONF_NAME),
        group_address=config.get(CONF_ADDRESS),
        group_address_state=config.get(CONF_STATE_ADDRESS))
    hass.data[DATA_KNX].xknx.devices.add(switch)
    async_add_entities([KNXSwitch(switch)])
github home-assistant / home-assistant / homeassistant / components / sensor / knx.py View on Github external
def async_add_entities_config(hass, config, async_add_entities):
    """Set up sensor for KNX platform configured within platform."""
    import xknx
    sensor = xknx.devices.Sensor(
        hass.data[DATA_KNX].xknx,
        name=config.get(CONF_NAME),
        group_address=config.get(CONF_ADDRESS),
        value_type=config.get(CONF_TYPE))
    hass.data[DATA_KNX].xknx.devices.add(sensor)
    async_add_entities([KNXSensor(sensor)])