def test_ctrl_neutral1(): """Test ctrl neutral 1 sends correct request.""" sec = 8 ieee = 0 nwk = 1234 data = b"\x01\x08\x01" cluster = 6 src_ep = 1 dst_ep = 2 app = zigpy.application.ControllerApplication() app.request = mock.MagicMock() app.get_sequence = mock.MagicMock(return_value=sec) rep = Device(app, ieee, nwk) rep.add_endpoint(1) rep.add_endpoint(2) dev = CtrlNeutral1(app, ieee, nwk, rep) dev[2].in_clusters[cluster].command(1) assert app.request.call_args == call(dev, 260, cluster, src_ep, dst_ep, sec, data, expect_reply=True)
def coordinator(app, ieee): dev = Device(app, ieee, 0x0000) ep = dev.add_endpoint(1) ep.profile_id = 0x0104 ep.device_type = 0xBEEF ep.add_output_cluster(security.IasZone.cluster_id) return bellows.zigbee.application.EZSPCoordinator(app, ieee, 0x0000, dev)