Beispiel #1
0
 def add_device(self, ieee, nwk):
     assert isinstance(ieee, t.EmberEUI64)
     if ieee in self.devices:
         # TODO: Check NWK?
         return self.devices[ieee]
     dev = device.Device(self, ieee, nwk)
     self.devices[ieee] = dev
     return dev
Beispiel #2
0
def test_get_aps():
    app_mock = mock.MagicMock()
    ieee = t.EmberEUI64(map(t.uint8_t, [0, 1, 2, 3, 4, 5, 6, 7]))
    dev = device.Device(app_mock, ieee, 65535)
    ep = endpoint.Endpoint(dev, 55)
    ep.status = endpoint.Status.INITIALIZED
    ep.profile_id = 99
    aps = ep.get_aps(255)
    assert aps.profileId == 99
    assert aps.clusterId == 255
    assert aps.sourceEndpoint == 55
    assert aps.destinationEndpoint == 55
Beispiel #3
0
def dev():
    app_mock = mock.MagicMock()
    ieee = t.EmberEUI64(map(t.uint8_t, [0, 1, 2, 3, 4, 5, 6, 7]))
    return device.Device(app_mock, ieee, 65535)