Ejemplo n.º 1
0
async def test_deconz_dev_remove_from_group(app, nwk, device_path):
    group = MagicMock()
    app.groups[sentinel.grp_id] = group
    deconz = application.DeconzDevice(0, device_path, app, sentinel.ieee, nwk)
    deconz.endpoints = {
        0: sentinel.zdo,
        1: sentinel.ep1,
        2: sentinel.ep2,
    }

    await deconz.remove_from_group(sentinel.grp_id)
    assert group.remove_member.call_count == 2
Ejemplo n.º 2
0
async def test_deconz_dev_add_to_group(app, nwk, device_path):
    group = MagicMock()
    app._groups = MagicMock()
    app._groups.add_group.return_value = group

    deconz = application.DeconzDevice(0, device_path, app, sentinel.ieee, nwk)
    deconz.endpoints = {
        0: sentinel.zdo,
        1: sentinel.ep1,
        2: sentinel.ep2,
    }

    await deconz.add_to_group(sentinel.grp_id, sentinel.grp_name)
    assert group.add_member.call_count == 2

    assert app.groups.add_group.call_count == 1
    assert app.groups.add_group.call_args[0][0] is sentinel.grp_id
    assert app.groups.add_group.call_args[0][1] is sentinel.grp_name
Ejemplo n.º 3
0
def test_deconz_name(nwk, name, firmware_version, device_path):
    deconz = application.DeconzDevice(firmware_version, device_path, app,
                                      sentinel.ieee, nwk)
    assert deconz.model == name
Ejemplo n.º 4
0
def test_deconz_props(nwk, device_path):
    deconz = application.DeconzDevice(0, device_path, app, sentinel.ieee, nwk)
    assert deconz.manufacturer is not None
    assert deconz.model is not None