Ejemplo n.º 1
0
async def zha_client(hass, config_entry, zha_gateway, hass_ws_client):
    """Test zha switch platform."""

    # load the ZHA API
    async_load_api(hass)

    # create zigpy device
    await async_init_zigpy_device(
        hass,
        [general.OnOff.cluster_id, general.Basic.cluster_id],
        [],
        None,
        zha_gateway,
    )

    await async_init_zigpy_device(
        hass,
        [general.OnOff.cluster_id, general.Basic.cluster_id, general.Groups.cluster_id],
        [],
        zigpy.profiles.zha.DeviceType.ON_OFF_LIGHT,
        zha_gateway,
        manufacturer="FakeGroupManufacturer",
        model="FakeGroupModel",
        ieee="01:2d:6f:00:0a:90:69:e8",
    )

    # load up switch domain
    await hass.config_entries.async_forward_entry_setup(config_entry, DOMAIN)
    await hass.async_block_till_done()
    await hass.config_entries.async_forward_entry_setup(config_entry, light_domain)
    await hass.async_block_till_done()

    return await hass_ws_client(hass)
Ejemplo n.º 2
0
async def zha_client(hass, config_entry, zha_gateway, hass_ws_client):
    """Test zha switch platform."""
    from zigpy.zcl.clusters.general import OnOff, Basic

    # load the ZHA API
    async_load_api(hass)

    # create zigpy device
    await async_init_zigpy_device(hass, [OnOff.cluster_id, Basic.cluster_id],
                                  [], None, zha_gateway)

    # load up switch domain
    await hass.config_entries.async_forward_entry_setup(config_entry, DOMAIN)
    await hass.async_block_till_done()

    return await hass_ws_client(hass)
Ejemplo n.º 3
0
async def zha_client(hass, config_entry, zha_gateway, hass_ws_client):
    """Test zha switch platform."""
    from zigpy.zcl.clusters.general import OnOff, Basic

    # load the ZHA API
    async_load_api(hass)

    # create zigpy device
    await async_init_zigpy_device(
        hass, [OnOff.cluster_id, Basic.cluster_id], [], None, zha_gateway)

    # load up switch domain
    await hass.config_entries.async_forward_entry_setup(
        config_entry, DOMAIN)
    await hass.async_block_till_done()

    return await hass_ws_client(hass)
Ejemplo n.º 4
0
async def zha_client(hass, hass_ws_client, device_switch, device_groupable):
    """Test zha switch platform."""

    # load the ZHA API
    async_load_api(hass)
    return await hass_ws_client(hass)